--- !ruby/object:RDoc::RI::ModuleDescription 
attributes: []

class_methods: 
- !ruby/object:RDoc::RI::MethodSummary 
  name: extend_object
- !ruby/object:RDoc::RI::MethodSummary 
  name: new
comment: 
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: "Adds monitor functionality to an arbitrary object by mixing the module with <tt>include</tt>. For example:"
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "   require 'monitor'\n\n   buf = []\n   buf.extend(MonitorMixin)\n   empty_cond = buf.new_cond\n\n   # consumer\n   Thread.start do\n     loop do\n       buf.synchronize do\n         empty_cond.wait_while { buf.empty? }\n         print buf.shift\n       end\n     end\n   end\n\n   # producer\n   while line = ARGF.gets\n     buf.synchronize do\n       buf.push(line)\n       empty_cond.signal\n     end\n   end\n"
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: The consumer thread waits for the producer thread to push a line to buf while buf.empty?, and the producer thread (main thread) reads a line from ARGF and push it to buf, then call empty_cond.signal.
constants: []

full_name: MonitorMixin
includes: []

instance_methods: 
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_check_owner
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_enter
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_enter_for_cond
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_exit
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_exit_for_cond
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_initialize
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_synchronize
- !ruby/object:RDoc::RI::MethodSummary 
  name: mon_try_enter
- !ruby/object:RDoc::RI::MethodSummary 
  name: new_cond
- !ruby/object:RDoc::RI::MethodSummary 
  name: synchronize
- !ruby/object:RDoc::RI::MethodSummary 
  name: try_mon_enter
name: MonitorMixin
