diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-12-25 06:29:27 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-12-25 06:29:27 +0000 |
commit | eea16da9f859d0e876fd331066a230a44b9a6a50 (patch) | |
tree | f2ec985d66f5d99a203277cf0961d960228d441e /lib/singleton.rb | |
parent | d98cd107dbb710dd17f8f8446f746e8d602c74ec (diff) | |
download | ruby-eea16da9f859d0e876fd331066a230a44b9a6a50.tar.gz ruby-eea16da9f859d0e876fd331066a230a44b9a6a50.tar.xz ruby-eea16da9f859d0e876fd331066a230a44b9a6a50.zip |
001225
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/singleton.rb')
-rw-r--r-- | lib/singleton.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/singleton.rb b/lib/singleton.rb index 235ba898f..aa245b32b 100644 --- a/lib/singleton.rb +++ b/lib/singleton.rb @@ -16,10 +16,10 @@ module Singleton klass.instance_eval %{ @__instance__ = nil def instance - Thread.critical = true unless @__instance__ + Thread.critical = true begin - @__instance__ = new + @__instance__ ||= new ensure Thread.critical = false end |