8.16.0.2
15.2 Semaphore
A semaphore is a synchronizable event that has an internal counter. Posting to a semaphore increments its counter, and waiting on a semaphore blocks until the counter is positive and can be decremented. As a synchronizable event, a semaphore is ready for synchronization when its counter is positive; the synchronization result is just the semaphore itself.
Constructs a semaphore that initially has init
Semaphore.post actions.
A Semaphore object satisfies Evt and includes the Evt.sync method.
method | |
| |
method | |
| |
method | |
Posts, waits, or polls a semaphore. When Semaphore.poll
successfully waits on a semaphore, it returns #true, otherwise
it returns #false.
The Semaphore.handle property accesses a semaphore object’s
underlying Racket representation. The Semaphore.from_handle
function constructs a Rhombus semaphore object from a Racket semaphore
object.