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.
1 parent 09cd1d2 commit 6dc8149Copy full SHA for 6dc8149
lib/concurrent/atomic/event.rb
@@ -13,6 +13,27 @@ module Concurrent
13
# `#reset` at any time once it has been set.
14
#
15
# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx
16
+ # @example
17
+ # event = Concurrent::Event.new
18
+ #
19
+ # t1 = Thread.new do
20
+ # puts "t1 is waiting"
21
+ # event.wait(1)
22
+ # puts "event ocurred"
23
+ # end
24
25
+ # t2 = Thread.new do
26
+ # puts "t2 calling set"
27
+ # event.set
28
29
30
+ # [t1, t2].each(&:join)
31
32
+ # outputs
33
+ # "t2 calling set"
34
+ # "t1 is waiting"
35
+ # "event ocurred"
36
37
class Event < Synchronization::LockableObject
38
39
# Creates a new `Event` in the unset state. Threads calling `#wait` on the
0 commit comments