Description

The ASemaphore class defines an interprocess synchronization object that maintains a count between zero and some maximum value. It is used to synchronize multithreaded applications. The object's state is set to signaled when its count is greater than zero, and nonsignaled when its count is zero.

In any preemptively scheduled environment, the use of semaphores is vital to protect data structures that can be accessed by more than one thread of execution. The standard semaphore functions (Set, Clear, Wait, Request) are provided as DMOD entry points.

For example, if the emulator uses the routing procedure method of receiving messages, the routing procedure will be called from a different thread context to the main application thread. This may require the use of semaphore protection around emulator data structures.

Properties

 

Handle

InitialCount

MaxCount

Name

Tag

Methods

 

Lock

Unlock

See Also

ACriticalSelection, AEvent, AMutex