A synchronization object that allows one thread to wait on multiple other threads. The thread that will wait creates a CountDownLatch
and sets the initial value (normally equal to the number of other threads). The initiating thread passes the latch to the other threads then waits for the other threads by calling the #wait
method. Each of the other threads calls #count_down
when done with its work. When the latch counter reaches zero the waiting thread is unblocked and continues with its work. A CountDownLatch
can be used only once. Its value cannot be reset.
The current value of the counter.
Signal the latch to decrement the counter.
Create a new CountDownLatch
with the initial count
.
Block on the latch until the counter reaches zero or until timeout
is reached.
Create a new CountDownLatch
with the initial count
.
98 99
# File 'lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb', line 98 class CountDownLatch < CountDownLatchImplementation endInstance Method Details #count ⇒ Fixnum
The current value of the counter.
98 99
# File 'lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb', line 98 class CountDownLatch < CountDownLatchImplementation end#count_down ⇒ undocumented
Signal the latch to decrement the counter. Will signal all blocked threads when the count
reaches zero.
98 99
# File 'lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb', line 98 class CountDownLatch < CountDownLatchImplementation end#wait(timeout = nil) ⇒ Boolean
Block on the latch until the counter reaches zero or until timeout
is reached.
98 99
# File 'lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb', line 98 class CountDownLatch < CountDownLatchImplementation end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4