diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/thread.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/thread.rb b/lib/thread.rb index 2769c54c3e..3baa951522 100644 --- a/lib/thread.rb +++ b/lib/thread.rb @@ -21,16 +21,18 @@ if $DEBUG Thread.abort_on_exception = true end -# -# FIXME: not documented in Pickaxe or Nutshell. -# -def Thread.exclusive - _old = Thread.critical - begin - Thread.critical = true - return yield - ensure - Thread.critical = _old +class Thread + # + # FIXME: not documented in Pickaxe or Nutshell. + # + def Thread.exclusive + _old = Thread.critical + begin + Thread.critical = true + return yield + ensure + Thread.critical = _old + end end end |