summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.rb')
-rw-r--r--lib/thread.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index fd51d6d..12fe81c 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -21,13 +21,13 @@ if $DEBUG
end
def Thread.exclusive
+ _old = Thread.critical
begin
Thread.critical = true
- r = yield
+ return yield
ensure
- Thread.critical = false
+ Thread.critical = _old
end
- r
end
class Mutex