summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
authorgsinclair <gsinclair@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-16 01:53:12 +0000
committergsinclair <gsinclair@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-16 01:53:12 +0000
commitfb12e2380399a035aec5ab01a9ba326d9255e6c4 (patch)
tree976ed098e616f285af1c128e46aed06b7f465780 /lib/thread.rb
parent5abcd32d57c490cd246af8bfd324d8c24b3195dc (diff)
* lib/thread.rb (Thread.exclusive): wrap method definition in
class Thread to enable rdoc to process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/thread.rb')
-rw-r--r--lib/thread.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index 2769c54c3e9..3baa951522c 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