Object
FIXME: This isn’t documented in Nutshell.
Since MonitorMixin#new_cond returns a ConditionVariable, and the example above calls while_wait and signal, this class should be documented.
# File monitor.rb, line 121
def broadcast
@monitor.__send__(:mon_check_owner)
@cond.broadcast
end
# File monitor.rb, line 126
def count_waiters
raise NotImplementedError
end
# File monitor.rb, line 116
def signal
@monitor.__send__(:mon_check_owner)
@cond.signal
end
# File monitor.rb, line 90
def wait(timeout = nil)
if timeout
raise NotImplementedError, "timeout is not implemented yet"
end
@monitor.__send__(:mon_check_owner)
count = @monitor.__send__(:mon_exit_for_cond)
begin
@cond.wait(@monitor.instance_variable_get("@mon_mutex"))
return true
ensure
@monitor.__send__(:mon_enter_for_cond, count)
end
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.