semaphore

Semaphores allow processes and threads to synchronize their actions.
A semaphore is an integer whose value is never allowed to fall below zero.  Two operations can be performed on semaphores: increment the semaphore value by one; and decrement the semaphore value by one.  If the value of a semaphore is currently zero, then a sem_wait operation will block until the value becomes greater than zero.