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 a261263 + d9e8787 commit 2895b55Copy full SHA for 2895b55
lib/concurrent/atomic/event.rb
@@ -13,6 +13,26 @@ 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
+ # # prints:
33
+ # # t2 calling set
34
+ # # t1 is waiting
35
+ # # event ocurred
36
class Event < Synchronization::LockableObject
37
38
# Creates a new `Event` in the unset state. Threads calling `#wait` on the
0 commit comments