Module: ProcessShared::MonitorMixin
- Defined in:
- lib/process_shared/monitor_mixin.rb
Class Method Summary collapse
Instance Method Summary collapse
- #mon_enter ⇒ Object
- #mon_exit ⇒ Object
- #mon_synchronize ⇒ Object (also: #synchronize)
- #mon_try_enter ⇒ Object (also: #try_mon_enter)
- #new_cond ⇒ Object
Class Method Details
.extended(obj) ⇒ Object
5 6 7 |
# File 'lib/process_shared/monitor_mixin.rb', line 5 def self.extended(obj) obj.send :mon_initialize end |
Instance Method Details
#mon_enter ⇒ Object
9 10 11 |
# File 'lib/process_shared/monitor_mixin.rb', line 9 def mon_enter @mon_monitor.lock end |
#mon_exit ⇒ Object
13 14 15 |
# File 'lib/process_shared/monitor_mixin.rb', line 13 def mon_exit @mon_monitor.unlock end |
#mon_synchronize ⇒ Object Also known as: synchronize
17 18 19 20 21 22 23 24 |
# File 'lib/process_shared/monitor_mixin.rb', line 17 def mon_synchronize mon_enter begin yield ensure mon_exit end end |
#mon_try_enter ⇒ Object Also known as: try_mon_enter
27 28 29 |
# File 'lib/process_shared/monitor_mixin.rb', line 27 def mon_try_enter raise NotImplementedError, 'not implemented' end |
#new_cond ⇒ Object
32 33 34 |
# File 'lib/process_shared/monitor_mixin.rb', line 32 def new_cond raise NotImplementedError, 'not implemented' end |