diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-06 14:19:33 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-06 14:19:33 +0000 |
commit | 85d105cf8c7c664d34bf86b8d72c728cb5b6e7ab (patch) | |
tree | 261030f30316bd72fa88aba98d1d0932bfa6158f /lib/mutex_m.rb | |
parent | b2658a3d839916db0cde8e810212932d1dc63cd5 (diff) | |
download | ruby-85d105cf8c7c664d34bf86b8d72c728cb5b6e7ab.tar.gz |
* lib/sync.rb: bug fix if obj.initialize has parameters when
obj.extend(Sync_m)
* lib/mutex_m.rb: modified bit
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mutex_m.rb')
-rw-r--r-- | lib/mutex_m.rb | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/mutex_m.rb b/lib/mutex_m.rb index fe05a45e9d..0192d83bee 100644 --- a/lib/mutex_m.rb +++ b/lib/mutex_m.rb @@ -25,18 +25,19 @@ # module Mutex_m + def Mutex_m.define_aliases(cl) + cl.module_eval %q{ + alias locked? mu_locked? + alias lock mu_lock + alias unlock mu_unlock + alias try_lock mu_try_lock + alias synchronize mu_synchronize + } + end + def Mutex_m.append_features(cl) super - unless cl.instance_of?(Module) - cl.module_eval %q{ - alias locked? mu_locked? - alias lock mu_lock - alias unlock mu_unlock - alias try_lock mu_try_lock - alias synchronize mu_synchronize - } - end - self + define_aliases(cl) unless cl.instance_of?(Module) end def Mutex_m.extend_object(obj) @@ -50,13 +51,7 @@ module Mutex_m defined? unlock and defined? try_lock and defined? synchronize) - eval "class << self - alias locked? mu_locked? - alias lock mu_lock - alias unlock mu_unlock - alias try_lock mu_try_lock - alias synchronize mu_synchronize - end" + Mutex_m.define_aliases(class<<self;self;end) end mu_initialize end |