Back: ScaledDecimal-storing
Up: Class reference
Forward: Semaphore class-instance creation
 
Top: GNU Smalltalk User's Guide
Contents: Table of Contents
Index: Class index
About: About this document

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  (class)
6.124.2 Semaphore: builtins  (instance)
6.124.3 Semaphore: mutual exclusion  (instance)


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!!!




This document was generated on May, 12 2002 using texi2html