Creating a Semaphore

A semaphore stores a count of abstract units. It does not store messages or objects, so it has no message queue. The semaphore is created with an initial value, which can be from 0 up to the maximum specified which must be at least 1.
A semaphore has a thread queue, just like a mailbox. Threads can be queued FIFO or according to their priority.