3 summary::block execution of a thread
8 Create a new instance, set the strong::test:: variable.
13 Return the test variable (boolean).
16 Wait until the condition is true and signalled.
19 Wait for strong::value:: time, regardless of test.
22 If link::#-test:: is true, reschedule blocked threads.
31 c = Condition.new(false);
35 "waited for 1 second".postln;
37 "waited for another second, now waiting for you ... ".postln;
39 "the condition has stopped waiting.".postln;
41 "waited for another second".postln;
42 "waiting for you ... ".postln;
45 "the condition has stopped waiting.".postln;
57 // a typical use is a routine that can pause under certin conditions:
60 fork { loop { 1.wait; "going".postln; c.wait } };
62 c.test = true; c.signal;
67 // the same, using hang
74 "waited for 1 second".postln;
76 "waited for another second, now waiting for you ... ".postln;
78 "the condition has stopped waiting.".postln;
80 "waited for another second".postln;
81 "waiting for you ... ".postln;
83 "the condition has stopped waiting.".postln;