RiCOSSemaphore class

A semaphore is a synchronization device that allows a limited number of threads in one or more processes to access a resource. The semaphore maintains a count of the number of threads currently accessing the resource.

Semaphores are useful in controlling access to a shared resource that can support only a limited number of users. The current count of the semaphore is the number of additional users allowed. When the count reaches zero, all attempts to use the resource controlled by the semaphore are inserted into a system queue and wait until they either time out or the count again rises above zero. The maximum number of users who can access the controlled resource at one time is specified at construction time.

The Rational® Rhapsody® framework itself does not use semaphores. However, the RiCOSSemaphore primitive is provided as a service for environments that need it (such as Windows NT and pSOSystem).

Creation summary
create
Creates an RiCOSSemaphore object
destroy
Destroys the RiCOSSemaphore object
cleanup
Cleans up after an RiCOSSemaphore object
init
Initializes an RiCOSSemaphore object
Method summary
signal
Releases the semaphore token
wait
Waits for a semaphore token

Feedback