class Rbgo::IOReceipt
Attributes
cond[RW]
done_flag[RW]
mutex[RW]
registered_op[RW]
res[RW]
Public Class Methods
new(op)
click to toggle source
# File lib/rbgo/io_receipt.rb, line 28 def initialize(op) self.done_flag = false self.mutex = Mutex.new self.cond = ConditionVariable.new self.registered_op = op end
Public Instance Methods
notify()
click to toggle source
# File lib/rbgo/io_receipt.rb, line 15 def notify mutex.synchronize do self.done_flag = true cond.signal end nil end
wait()
click to toggle source
# File lib/rbgo/io_receipt.rb, line 6 def wait mutex.synchronize do until done_flag cond.wait(mutex) end end nil end