Condition:
Filter:
Classes | Scheduling

Condition : Object

Block the execution of a thread
Source: Condition.sc

Class Methods

Condition.new(test: false)

Create a new instance, set the test variable.

Inherited class methods

Instance Methods

.test

.test = value

Answer whether the condition will block or not (boolean).

.wait

Wait until the condition is true and signalled. This only works in a Routine. This method yields a symbol (\hang), so that the clock doesn't reschedule the Routine.

.hang(value: 'hang')

Wait for value time, regardless of test. This only works in a Routine. This method yields a symbol (\hang), so that the clock doesn't reschedule the Routine.

.signal

If -test is true, reschedule blocked threads.

.unhang

Resume threads.

Inherited instance methods

Examples

Waiting for Synths to end (waitForFree) uses a Condition implicitly: