Monitor.rb for ruby-1.9

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

ruby 1.9 e$B$Ne(B monitor.rb e$B$G$9$,e(B,

def mon_try_enter
if @mon_owner != Thread.current
unless @mon_owner.trylock #<— e$B$3$3e(B
return false
end
@mon_owner = Thread.current
end
@mon_count += 1
return true
end

e$B$Ne(B e$B!X$3$3!Y$Oe(B

  unless @mon_mutex.trylock #<--- e$B$3$3e(B

e$B$N4V0c$$$G$Oe(B?

__
---------------------------------------------------->> [email protected](B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$BA0ED$G$9!#e(B

On 03/08/2007 11:40 PM, Keiju ISHITSUKA wrote:

e$B$Ne(B e$B!X$3$3!Y$Oe(B

  unless @mon_mutex.trylock #<--- e$B$3$3e(B

e$B$N4V0c$$$G$Oe(B?

e$B%a%=%C%IL>$b4V0c$C$F$$$k$h$&$G!"e(B

unless @mon_mutex.try_lock

e$B$,@5$7$$$G$9$M!#e(B

[email protected]$[[email protected]$re(Bcommite$B$7$^$7$?$N$G$43NG’$/[email protected]$5$$!#e(B

[email protected][email protected]$$$?$h$&$J$N$G$9$,!"$"$^$je(B
e$BF0:n$O3NG’$5$l$F$$$J$5$=$&$G$9!#e(B
e$B9g=I$N;~$Ke(Bsynchronizee$B$,F0$/[email protected]$7$?$N$G$9$,!"D>$7$-$l$Fe(B
e$B$$$^$;$s$G$7$?!#$9$_$^$;$s!#e(B

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev:30550] the message: “[ruby-dev:30550] Re: monitor.rb for
ruby-1.9”, on Mar/13 07:29(JST) Shugo M. writes:

e$BA0ED$G$9!#e(B

e$B%a%=%C%IL>$b4V0c$C$F$$$k$h$&$G!"e(B
unless @mon_mutex.try_lock
e$B$,@5$7$$$G$9$M!#e(B

e$B$"$i$^e(B(^^;

[email protected]$[[email protected]$re(Bcommite$B$7$^$7$?$N$G$43NG’$/[email protected]$5$$!#e(B

[email protected][email protected]$$$?$h$&$J$N$G$9$,!"$"$^$je(B
e$BF0:n$O3NG’$5$l$F$$$J$5$=$&$G$9!#e(B
e$B9g=I$N;~$Ke(Bsynchronizee$B$,F0$/[email protected]$7$?$N$G$9$,!"D>$7$-$l$Fe(B
e$B$$$^$;$s$G$7$?!#$9$_$^$;$s!#e(B

e$B$o$?$7$be(B,
ruby-1.9e$B7O$Ge(Bsync.rbe$B$J$I$,F0$+$J$$$3$H$K5$$,IU$$$Fe(B,
[email protected]$7$Fe(B
e$B$$$Fe(B monitor.rb
e$B$H$+$O$I$&$J$C$F$$$k$+$H;W$C$FD4$Y$F$$$?$i5$$,IU$-$^$7e(B
e$B$?e(B.
ruby-1.9e$B$K$J$C$FF0$$$F$$$J$$$N$,7k9=$"$k$h$&$J5$$,$9$ke(B…

__
---------------------------------------------------->> [email protected](B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

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