3 # $Release Version: 3.0$
5 # Original from mutex.rb
6 # by Keiju ISHITSUKA(keiju@ishitsuka.com)
8 # patched by akira yamada
12 # require "mutex_m.rb"
16 # extended object can be handled like Mutex
23 # this obj can be handled like Mutex
29 def Mutex_m.define_aliases(cl)
31 alias locked? mu_locked?
33 alias unlock mu_unlock
34 alias try_lock mu_try_lock
35 alias synchronize mu_synchronize
39 def Mutex_m.append_features(cl)
41 define_aliases(cl) unless cl.instance_of?(Module)
44 def Mutex_m.extend_object(obj)
50 unless (defined? locked? and
55 Mutex_m.define_aliases(class<<self;self;end)
61 def mu_synchronize(&block)
62 @_mutex.synchronize(&block)