Enters exclusive section.
# File monitor/lib/monitor.rb, line 169 def mon_enter @mon_data.enter end
Leaves exclusive section.
# File monitor/lib/monitor.rb, line 176 def mon_exit mon_check_owner @mon_data.exit end
Returns true if this monitor is locked by any thread
# File monitor/lib/monitor.rb, line 184 def mon_locked? @mon_data.mon_locked? end
Returns true if this monitor is locked by current thread.
# File monitor/lib/monitor.rb, line 191 def mon_owned? @mon_data.mon_owned? end
Enters exclusive section and executes the block. Leaves the exclusive
section automatically when the block exits. See example under
MonitorMixin
.
# File monitor/lib/monitor.rb, line 200 def mon_synchronize(&b) @mon_data.synchronize(&b) end
Attempts to enter exclusive section. Returns false
if lock
fails.
# File monitor/lib/monitor.rb, line 160 def mon_try_enter @mon_data.try_enter end
Creates a new MonitorMixin::ConditionVariable associated with the Monitor object.
# File monitor/lib/monitor.rb, line 209 def new_cond unless defined?(@mon_data) mon_initialize @mon_initialized_by_new_cond = true end return ConditionVariable.new(@mon_data) end