summaryrefslogtreecommitdiff
path: root/prelude.rb
diff options
context:
space:
mode:
Diffstat (limited to 'prelude.rb')
-rw-r--r--prelude.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/prelude.rb b/prelude.rb
index 27d54d1740..7cfe0892b3 100644
--- a/prelude.rb
+++ b/prelude.rb
@@ -8,11 +8,9 @@ class Thread
# Wraps the block in a single, VM-global Mutex.synchronize, returning the
# value of the block. A thread executing inside the exclusive section will
# only block other threads which also use the Thread.exclusive mechanism.
- def self.exclusive
+ def self.exclusive(&block)
warn "Thread.exclusive is deprecated, use Thread::Mutex", caller
- MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
- yield
- }
+ MUTEX_FOR_THREAD_EXCLUSIVE.synchronize(&block)
end
end