class Concurrent::Synchronization::MonitorLockableObject

@!visibility private @!macro internal_implementation_note

Public Class Methods

new(*defaults) click to toggle source
# File lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb, line 64
def initialize(*defaults)
  super(*defaults)
  @__Lock__      = ::Monitor.new
  @__Condition__ = @__Lock__.new_cond
end

Public Instance Methods

initialize_copy(other) click to toggle source
Calls superclass method
# File lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb, line 70
def initialize_copy(other)
  super
  @__Lock__      = ::Monitor.new
  @__Condition__ = @__Lock__.new_cond
end

Protected Instance Methods

ns_wait(timeout = nil) click to toggle source
# File lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb, line 82
def ns_wait(timeout = nil)
  @__Condition__.wait timeout
  self
end
synchronize() { || ... } click to toggle source
# File lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb, line 78
def synchronize # TODO may be a problem with lock.synchronize { lock.wait }
  @__Lock__.synchronize { yield }
end