diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-01-20 04:59:39 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-01-20 04:59:39 +0000 |
commit | 210367ec889f5910e270d6ea2c7ddb8a8d939e61 (patch) | |
tree | feb35473da45947378fbc02defe39bcd79ef600e /lib/sync.rb | |
parent | 9c5b1986a36c7a700b4c76817e35aa874ba7907c (diff) | |
download | ruby-210367ec889f5910e270d6ea2c7ddb8a8d939e61.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r372,
which included commits to RCS files with non-trunk default branches.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/sync.rb')
-rw-r--r-- | lib/sync.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/sync.rb b/lib/sync.rb index b5a3fc32b3..9f9706d9ee 100644 --- a/lib/sync.rb +++ b/lib/sync.rb @@ -4,6 +4,7 @@ # $Revision$ # $Date$ # by Keiju ISHITSUKA +# modified by matz # # -- # Sync_m, Synchronizer_m @@ -43,7 +44,7 @@ unless defined? Thread fail "Thread not available for this ruby interpreter" end -require "finalize" +require "final" module Sync_m RCS_ID='-$Header$-' @@ -54,7 +55,7 @@ module Sync_m EX = :EX # Îã³°ÄêµÁ - class Err < Exception + class Err < StandardError def Err.Fail(*opt) fail self, sprintf(self::Message, *opt) end @@ -296,8 +297,8 @@ module Sync_m private :sync_try_lock_sub def sync_synchronize(mode = EX) + sync_lock(mode) begin - sync_lock(mode) yield ensure sync_unlock @@ -321,7 +322,11 @@ module Sync_m def For_primitive_object.extend_object(obj) super obj.sync_extended - Finalizer.add(obj, For_primitive_object, :sync_finalize) + # Changed to use `final.rb'. + # Finalizer.add(obj, For_primitive_object, :sync_finalize) + ObjectSpace.define_finalizer(obj) do |id| + For_primitive_object.sync_finalize(id) + end end def initialize |