Module: XThread::MonitorMixin
- Defined in:
- lib/xthread.rb
Class Method Summary collapse
Instance Method Summary collapse
- #mon_enter ⇒ Object
- #mon_exit ⇒ Object
- #mon_initialize ⇒ Object
- #mon_synchronize(&block) ⇒ Object
- #mon_try_enter ⇒ Object
- #new_cond ⇒ Object
Class Method Details
.extend_object(obj) ⇒ Object
25 26 27 28 |
# File 'lib/xthread.rb', line 25 def self.extend_object(obj) super(obj) obj.__send__(:mon_initialize) end |
Instance Method Details
#mon_enter ⇒ Object
38 39 40 |
# File 'lib/xthread.rb', line 38 def mon_enter @_monitor.enter end |
#mon_exit ⇒ Object
42 43 44 |
# File 'lib/xthread.rb', line 42 def mon_exit @_monitor.exit end |
#mon_initialize ⇒ Object
30 31 32 |
# File 'lib/xthread.rb', line 30 def mon_initialize @_monitor = Monitor.new end |
#mon_synchronize(&block) ⇒ Object
46 47 48 |
# File 'lib/xthread.rb', line 46 def mon_synchronize(&block) @_monitor.synchronize(&block) end |
#mon_try_enter ⇒ Object
34 35 36 |
# File 'lib/xthread.rb', line 34 def mon_try_enter @_monitor.try_enter end |
#new_cond ⇒ Object
50 51 52 |
# File 'lib/xthread.rb', line 50 def new_cond @_monitor.new_cond end |