Class: Monitor
- Inherits:
-
Object
- Object
- Monitor
- Defined in:
- lib/monitor.rb
Instance Method Summary collapse
-
#initialize ⇒ Monitor
constructor
A new instance of Monitor.
- #synchronize ⇒ Object
Constructor Details
#initialize ⇒ Monitor
Returns a new instance of Monitor.
6 7 8 |
# File 'lib/monitor.rb', line 6 def initialize @mutex = Mutex.new end |
Instance Method Details
#synchronize ⇒ Object
10 11 12 |
# File 'lib/monitor.rb', line 10 def synchronize @mutex.synchronize { yield } end |