Semaphore:
Filter:
Classes | Scheduling

Semaphore : Object

control parallel execution of threads
Source: Semaphore.sc

Class Methods

Semaphore.new(count: 1)

Create a new instance, set the maximum number of running threads (default: 1).

Inherited class methods

Instance Methods

.count

Determines the number of running threads.

.clear

Remove any reference to threads, but do not reschedule any pending ones.

.wait

Stop current thread if already too many are running, otherwise continue.

.signal

Unblock the semaphore, reschedule next pending thread.

Inherited instance methods

Examples