Class: ZeevexConcurrency::ThreadPool::FixedPool::HaltObject
- Inherits:
-
Object
- Object
- ZeevexConcurrency::ThreadPool::FixedPool::HaltObject
- Defined in:
- lib/zeevex_concurrency/thread_pool.rb
Instance Method Summary collapse
- #halt! ⇒ Object
-
#initialize(count) ⇒ HaltObject
constructor
A new instance of HaltObject.
- #wait ⇒ Object
Constructor Details
#initialize(count) ⇒ HaltObject
Returns a new instance of HaltObject.
307 308 309 310 |
# File 'lib/zeevex_concurrency/thread_pool.rb', line 307 def initialize(count) @count = count @latch = CountDownLatch.new(count) end |
Instance Method Details
#halt! ⇒ Object
312 313 314 315 316 |
# File 'lib/zeevex_concurrency/thread_pool.rb', line 312 def halt! # notify that we're now waiting @latch.countdown! @latch.wait end |
#wait ⇒ Object
318 319 320 |
# File 'lib/zeevex_concurrency/thread_pool.rb', line 318 def wait @latch.wait end |