summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-27 07:43:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-27 07:43:38 +0000
commit979de48915cd1c0d903eeed0fcec181ab80ef1ae (patch)
tree5caa2535e7447380b264c1ddedbad23da070ceb2 /lib/thread.rb
parent87fb7bb66daa35dcf1750e2f764da0167ac79938 (diff)
* lib/pstore.rb (transaction): allow overriding dump and load.
[ruby-dev:23567] * lib/yaml/store.rb: follow lib/pstore.rb's change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/thread.rb')
-rw-r--r--lib/thread.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index 3baa951522c..8b27356c485 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -189,11 +189,14 @@ class ConditionVariable
# Releases the lock held in +mutex+ and waits; reacquires the lock on wakeup.
#
def wait(mutex)
- mutex.exclusive_unlock do
- @waiters.push(Thread.current)
- Thread.stop
+ begin
+ mutex.exclusive_unlock do
+ @waiters.push(Thread.current)
+ Thread.stop
+ end
+ ensure
+ mutex.lock
end
- mutex.lock
end
#