Class: Rbgo::IOReceipt

Inherits:
Object
  • Object
show all
Defined in:
lib/rbgo/io_receipt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#done_flagObject

Returns the value of attribute done_flag.



3
4
5
# File 'lib/rbgo/io_receipt.rb', line 3

def done_flag
  @done_flag
end

#registered_opObject

Returns the value of attribute registered_op.



3
4
5
# File 'lib/rbgo/io_receipt.rb', line 3

def registered_op
  @registered_op
end

#resObject

Returns the value of attribute res.



4
5
6
# File 'lib/rbgo/io_receipt.rb', line 4

def res
  @res
end

Instance Method Details

#notifyObject



15
16
17
18
19
20
21
# File 'lib/rbgo/io_receipt.rb', line 15

def notify
  mutex.synchronize do
    self.done_flag = true
    cond.signal
  end
  nil
end

#waitObject



6
7
8
9
10
11
12
13
# File 'lib/rbgo/io_receipt.rb', line 6

def wait
  mutex.synchronize do
    until done_flag
      cond.wait(mutex)
    end
  end
  nil
end