diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-27 09:49:34 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-27 09:49:34 +0000 |
commit | f828756f01c8c6221ad2f5e051c708fb309406c9 (patch) | |
tree | 27bc06133685cb3d4bcb75cfc81b3cda6cdf8e04 /lib | |
parent | 4257651cd250a58f3dbfa495d1218f91da477f5e (diff) | |
download | ruby-f828756f01c8c6221ad2f5e051c708fb309406c9.tar.gz ruby-f828756f01c8c6221ad2f5e051c708fb309406c9.tar.xz ruby-f828756f01c8c6221ad2f5e051c708fb309406c9.zip |
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/delegate.rb | 2 | ||||
-rw-r--r-- | lib/weakref.rb | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb index 29f2a5ded..480e1ef6b 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -39,7 +39,7 @@ class Delegator raise end end - EOS + EOS end end diff --git a/lib/weakref.rb b/lib/weakref.rb index 9e510d6f1..459f69f92 100644 --- a/lib/weakref.rb +++ b/lib/weakref.rb @@ -45,7 +45,13 @@ class WeakRef<Delegator @__id = orig.__id__ ObjectSpace.define_finalizer orig, @@final ObjectSpace.define_finalizer self, @@final - ID_MAP[@__id] = [] unless ID_MAP[@__id] + __old_status = Thread.critical + begin + Thread.critical = true + ID_MAP[@__id] = [] unless ID_MAP[@__id] + ensure + Thread.critical = __old_status + end ID_MAP[@__id].push self.__id__ ID_REV_MAP[self.id] = @__id end |