15.4 Synchronizable Events
A synchronizable event is an object that can be used with Evt.sync to wait until it is ready for synchronization. Synchronizing a ready event may have a side effect and an associated value. For example, synchronizing on a Semaphore is the same as using Semaphore.wait, so it decrements the semaphore’s count.
annotation | |
The Evt annotation interface-like in the sense that every Evt supports the Evt.sync method.
method | ||||||
|
If return is #'no_break, then wrapf is called with breaks (in the sense of Thread.break) disabled.
If return is #'tail, then wrapf is called in tail position with respect to a synchronization request via Evt.sync. When the Evt produced by Evt.wrap is wrapped by another Evt.wrap with #'no_break, however, this tail-call behavior is disabled.
The Evt.never synchronizable event is never ready for synchronization.
The Evt.system_idle synchronizable event becomes ready when no thread can run otherwise. In other words, all threads must be suspended or blocked on events with timeouts that have not yet expired. Its synchronization result is #void. The Evt.system_idle event is intended primarily for use in tests where all concurrency is known.
annotation | |
| |
annotation | |
A CommitEvt is used in combination with a ProgressEvt for Port.Input.Progress.commit. A CommitEvt is either a Semaphore, channel-put event, channel, semaphore-peek event, Evt.always, or Evt.never.
interface | |
The interface has a single abstract method:
as_evt() —
produces an synchronizable event that can be used in Evt.sync.