Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6c56dae4b2
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (14 sloc) 0.367 kb
class Thread
MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new # :nodoc:
# call-seq:
# Thread.exclusive { block } => obj
#
# Wraps a block in Thread.critical, restoring the original value
# upon exit from the critical section, and returns the value of the
# block.
def self.exclusive
MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
yield
}
end
end
Jump to Line
Something went wrong with that request. Please try again.