Class: FiberMon::RBFiberMon::Monitor
- Inherits:
-
Monitor
- Object
- Monitor
- FiberMon::RBFiberMon::Monitor
- Extended by:
- Forwardable
- Defined in:
- lib/fiber-mon.rb
Instance Method Summary collapse
- #fiber_yield ⇒ Object (also: #yield)
-
#initialize(fibmon) ⇒ Monitor
constructor
A new instance of Monitor.
- #new_cv ⇒ Object
Constructor Details
#initialize(fibmon) ⇒ Monitor
Returns a new instance of Monitor.
167 168 169 170 |
# File 'lib/fiber-mon.rb', line 167 def initialize(fibmon) super() @fibmon = fibmon end |
Instance Method Details
#fiber_yield ⇒ Object Also known as: yield
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/fiber-mon.rb', line 179 def fiber_yield begin mon_check_owner rescue return Fiber.yield end if (count = mon_exit_for_cond) > 0 begin Fiber.yield @mon_mutex ensure @mon_mutex.lock end else Fiber.yield end mon_enter_for_cond(count) end |
#new_cv ⇒ Object
175 176 177 |
# File 'lib/fiber-mon.rb', line 175 def new_cv ConditionVariable.new(self) end |