mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
19991125
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8e48dc16e9
commit
ebab487fcd
14 changed files with 630 additions and 101 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue