mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/thread.rb: do not redefine Mutex#synchronize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
33a9e63ad9
commit
97d26f32bb
2 changed files with 4 additions and 9 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sat Feb 24 15:41:22 2007 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/thread.rb: do not redefine Mutex#synchronize.
|
||||||
|
|
||||||
Sat Feb 24 15:14:02 2007 Shugo Maeda <shugo@ruby-lang.org>
|
Sat Feb 24 15:14:02 2007 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* lib/monitor.rb: rewritten using Mutex/ConditionVariable.
|
* lib/monitor.rb: rewritten using Mutex/ConditionVariable.
|
||||||
|
|
|
@ -21,15 +21,6 @@ if $DEBUG
|
||||||
Thread.abort_on_exception = true
|
Thread.abort_on_exception = true
|
||||||
end
|
end
|
||||||
|
|
||||||
class Mutex
|
|
||||||
def synchronize
|
|
||||||
self.lock
|
|
||||||
yield
|
|
||||||
ensure
|
|
||||||
self.unlock
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# ConditionVariable objects augment class Mutex. Using condition variables,
|
# ConditionVariable objects augment class Mutex. Using condition variables,
|
||||||
# it is possible to suspend while in the middle of a critical section until a
|
# it is possible to suspend while in the middle of a critical section until a
|
||||||
|
|
Loading…
Reference in a new issue