|
|
6.124 Semaphore
- Defined in namespace Smalltalk
- Category: Language-Processes
- My instances represent counting semaphores. I provide methods for signalling
the semaphore's availability, and methods for waiting for its availability.
I also provide some methods for implementing critical sections. I currently
do not (because the underlying system does not) support asynchronous
signals, such as might be generated by C signals.
6.124.1 Semaphore class: instance creation
- forMutualExclusion
- Answer a new semaphore with a signal on it. These semaphores are a useful shortcut when you use semaphores as critical sections.
- new
- Answer a new semaphore
6.124.2 Semaphore: builtins
- signal
- Signal the receiver, resuming a waiting process' if there is one
- wait
- Wait for the receiver to be signalled, suspending the executing process if it is not yet
6.124.3 Semaphore: mutual exclusion
- critical: aBlock
- Wait for the receiver to be free, execute aBlock and signal the receiver again. Return the result of evaluating aBlock. aBlock MUST NOT CONTAIN A RETURN!!!
|