Semaphore
Semaphore is a synchronization object proposed by Edsger Dijkstra. A semaphore is characterized by a natural number k. A task may atomically increase or decrease k. When k reaches 0 the tasks attempting to decrease it are blocked. These are released in an unspecified order when other tasks increase k, one per increment.
Semaphore is considered a low-level synchronization primitive. They are exposed to deadlocking.
See also mutex, a variant of semaphore.