Next: Delay Up: Thread Library Previous: Type Definitions

Synchronization Operations

semInit

Initializes semaphore s with a count of cnt. Semaphores in the kernel are normally allocated statically (i.e., Semaphore x) and must be initialized (semInit(&x, 1)) before they are used.

void semInit (Semaphore * s, int cnt)

semWait

Increments the use count for the semaphore. The current thread will either acquire the semaphore s or give up control until a semSignal is done by another thread and the scheduler runs.

void semWait (Semaphore * s)

semSignal

The current thread decrements the use count for semaphore s. The current thread continues executing. Note that if multiple threads are blocked on the semaphore, there is no policy about which thread will be awakened by the semSignal.

void semSignal (Semaphore * s)


Tue Nov 29 16:28:56 MST 1994