[Bug:1.9] sleep and Thread#run

1.9 e$B$G$Oe(B sleep e$B$G?2$F$$$k%9%l%C%I$re(B Thread#run
e$B$G5/$3$;$J$$e(B
e$B$h$&$G$9!#e(B

% ./ruby -ve ’
t = Thread.new {
t1 = Time.now
sleep 5
t2 = Time.now
p t2 - t1
}
sleep 1
t.run
t.join

ruby 1.9.0 (2008-07-16 revision 18083) [i686-linux]
5.139447392

sleep e$B$re(B Thread#run e$B$G5/$3$;$k$C$]$$$3$H$Oe(B rdoc
e$B$K=q$$$F$"$j$^e(B
e$B$9!#e(B

  • Suspends the current thread for duration seconds (which may be any
    number,
  • including a +Float+ with fractional seconds). Returns the actual
    number of
  • seconds slept (rounded), which may be less than that asked for if
    another
  • thread calls Thread#run. Zero arguments causes +sleep+
    to sleep
  • forever.

e$B$^$?!"e(B1.8 e$B$G$O5/$3$;$^$9!#e(B

% ruby-1.8 -ve ’
t = Thread.new {
t1 = Time.now
sleep 5
t2 = Time.now
p t2 - t1
}
sleep 1
t.run
t.join

ruby 1.8.7 (2008-07-10 revision 17572) [i686-linux]
1.002687

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:35542] [Bug:1.9] sleep and Thread#run”
on Wed, 16 Jul 2008 20:43:16 +0900, Tanaka A. [email protected]
writes:

|1.9 e$B$G$Oe(B sleep e$B$G?2$F$$$k%9%l%C%I$re(B Thread#run e$B$G5/$3$;$J$$e(B
|e$B$h$&$G$9!#e(B

|sleep e$B$re(B Thread#run e$B$G5/$3$;$k$C$]$$$3$H$Oe(B rdoc e$B$K=q$$$F$"$j$^e(B
|e$B$9!#e(B

1.8e$B$H$Oe(BThreade$B$N<BAu$,0c$&$N$G!"$J$s$i$+$N;v>p$Ge(B1.9e$B$O5/$3$;$Je(B
e$B$$$N$G$"$C$F$b<u$1F~$l$i$l$^$9!#[email protected]$7!"$=$N>l9g$Oe(Brdoce$B$O99?7e(B
e$B$9$Y$-$G$7$g$&$M!#e(B

In article [email protected],
Yukihiro M. [email protected] writes:

1.8e$B$H$Oe(BThreade$B$N<BAu$,0c$&$N$G!"$J$s$i$+$N;v>p$Ge(B1.9e$B$O5/$3$;$Je(B
e$B$$$N$G$"$C$F$b<u$1F~$l$i$l$^$9!#[email protected]$7!"$=$N>l9g$Oe(Brdoce$B$O99?7e(B
e$B$9$Y$-$G$7$g$&$M!#e(B

e$B$Y$D$K<B:]$K;H$C$F$$$F$H$$$&OC$G$O$J$/$F!"$^$?!“e(Bsleep e$B$9$kA0e(B
e$B$Ke(B run
e$B$7$A$c$C$?$i!”$H$$$&?4G[$bM-$k$N$G$=$l$+$^$$$^$;$s$,!"e(B
e$BB>$N%9%l%C%I$+$iDLCN$5$l$k$+0lDj;~4V7P2a$9$k$+$I$A$i$+$rBT$D!"e(B
e$B$H$$$&$N$Oe(B 1.9 e$B$G$O$I$N$h$&$K=q$/$N$G$7$g$&e(B?

[email protected]$G$9!#e(B

At Thu, 17 Jul 2008 00:28:55 +0900,
Yukihiro M. wrote in [ruby-dev:35549]:

1.8e$B$H$Oe(BThreade$B$N<BAu$,0c$&$N$G!"$J$s$i$+$N;v>p$Ge(B1.9e$B$O5/$3$;$Je(B
e$B$$$N$G$"$C$F$b<u$1F~$l$i$l$^$9!#[email protected]$7!"$=$N>l9g$Oe(Brdoce$B$O99?7e(B
e$B$9$Y$-$G$7$g$&$M!#e(B

[ruby-core:17270]e$B$rD>$7$?$H$-$N%P%0$G$9!#e(B

[ruby-dev:35542]e$B$,e(Bredminee$B$KEPO?$5$l$F$J$$$G$9$M!#e(B

e$B%A%1%C%He(B #289 e$B$,99?7$5$l$^$7$?!#e(B (by Koichi Sasada)

fixed at r18094.

http://redmine.ruby-lang.org/issues/show/289

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs