Semaphores are counters for resources shared between threads.
The basic operations on semaphores are: increment the counter atomically, and wait until the counter is non-null and decrement it atomically.
This chapter describes the Semaphore Library API of rtker.