1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* prelude.rb: add Thread.exclusive. This class method

is different from 1.8's.  Thread.exclusive only does
  synchronize with VM global mutex.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2007-08-25 01:09:08 +00:00
parent bdf32ff14f
commit c289cf3a1f
2 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Sat Aug 25 10:05:17 2007 Koichi Sasada <ko1@atdot.net>
* prelude.rb: add Thread.exclusive. This class method
is different from 1.8's. Thread.exclusive only does
synchronize with VM global mutex.
Sat Aug 25 09:39:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_s_try_convert): more document description.

View file

@ -10,3 +10,14 @@ class Mutex
end
end
# Thread
class Thread
MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new
def self.exclusive
MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
yield
}
end
end