diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-11-25 09:03:08 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-11-25 09:03:08 +0000 |
commit | ebab487fcd7633038b9272ddbe31c268cda15723 (patch) | |
tree | e7880ae217a2a58dbe35bcf0f94744bc03805e08 /lib/singleton.rb | |
parent | 8e48dc16e97a783a69f0972b4882ad2faae561ea (diff) | |
download | ruby-ebab487fcd7633038b9272ddbe31c268cda15723.tar.gz |
19991125
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/singleton.rb')
-rw-r--r-- | lib/singleton.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/singleton.rb b/lib/singleton.rb index 4aea574e7a..2785c77134 100644 --- a/lib/singleton.rb +++ b/lib/singleton.rb @@ -17,7 +17,12 @@ module Singleton @__instance__ = nil def instance unless @__instance__ - @__instance__ = new + Thread.critical = true + begin + @__instance__ = new + ensure + Thread.critical = false + end end return @__instance__ end |