@!visibility private @!macro internal_implementation_note
# File lib/concurrent/synchronization/mutex_lockable_object.rb, line 29 def initialize(*defaults) super(*defaults) @__Lock__ = ::Mutex.new @__Condition__ = ::ConditionVariable.new end
# File lib/concurrent/synchronization/mutex_lockable_object.rb, line 45 def ns_wait(timeout = nil) @__Condition__.wait @__Lock__, timeout self end
# File lib/concurrent/synchronization/mutex_lockable_object.rb, line 37 def synchronize if @__Lock__.owned? yield else @__Lock__.synchronize { yield } end end