mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
- 0.1.6 -> 2.0.0. - fixed image module URI. Thanks to Dmitry Borodaenko. - supported Atom. - supported ITunes module. - supported Slash module. * NEWS: added an entry for RSS Parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
25 lines
282 B
Ruby
25 lines
282 B
Ruby
|
|
# Mutex
|
|
|
|
class Mutex
|
|
def synchronize
|
|
self.lock
|
|
begin
|
|
yield
|
|
ensure
|
|
self.unlock
|
|
end
|
|
end
|
|
end
|
|
|
|
# Thread
|
|
|
|
class Thread
|
|
MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new
|
|
def self.exclusive
|
|
MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
|
|
yield
|
|
}
|
|
end
|
|
end
|
|
|