2009/4/1 Sean O'Halpin <sean.ohalpin / gmail.com>:
> On Tue, Mar 31, 2009 at 6:41 PM, Iki Baz Castillo <ibc / aliax.net> wrote:
>> El Martes 31 Marzo 2009, Sean O'Halpin escribi
>>> Hi,
>>>
>>> Just thought I'd share this to save anyone else the bafflement it caused
>>> me.
>>>
>>> In ruby 1.8.x and jruby, sleep(0) means do not sleep at all. In 1.9,
>>> it appears to mean sleep forever.
>>
>> I've tested it in Ruby 1.9.1 and sleep(0) means do not sleep at all.
>
> Hmmm.      𨰩   
> all versions (i.e. it doesn't wait). However, this is what I get on
> Mac OS X 10.4:
>
> $ multiruby -rtimeout -e 'Timeout::timeout(2) { sleep(0) }'
>
> [snip working versions]
>
> VERSION = v1_9_1_0
> CMD = ~/.multiruby/install/v1_9_1_0/bin/ruby -rtimeout -e
> Timeout::timeout(2) { sleep(0) }
>
> -e:1:in `sleep': execution expired (Timeout::Error)
>  >  庱
>
> RESULT = 256
>
> TOTAL RESULT = 1 failures out of 5
>
> Passed: jruby-1.2.0RC2, jruby-1.1.6, v1_8_6_110, 1.8.7-p72
> Failed: v1_9_1_0

Hm, works for me:

15:49:23 bas$ allruby -e 'puts Time.now; sleep 0; puts Time.now'
CYGWIN_NT-5.1 padrklemme1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
Wed Apr 01 15:49:24 +0200 2009
Wed Apr 01 15:49:24 +0200 2009
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
2009-04-01 15:49:25 +0100
2009-04-01 15:49:25 +0100
15:49:25 bas$

Cheers

robert


-- 
remember.guy do |as, often| as.you_can - without end