We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ef9bb7d + e895e25 commit e9b592dCopy full SHA for e9b592d
lib/concurrent/atomic/count_down_latch.rb
@@ -72,6 +72,29 @@ module Concurrent
72
# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset.
73
#
74
# @!macro count_down_latch_public_api
75
+ # @example Waiter and Decrementer
76
+ # latch = Concurrent::CountDownLatch.new(3)
77
+ #
78
+ # waiter = Thread.new do
79
+ # latch.wait()
80
+ # puts ("Waiter released")
81
+ # end
82
83
+ # decrementer = Thread.new do
84
+ # sleep(1)
85
+ # latch.count_down
86
+ # puts latch.count
87
88
89
90
91
92
93
94
95
96
97
+ # [waiter, decrementer].each(&:join)
98
class CountDownLatch < CountDownLatchImplementation
99
end
100
0 commit comments