Semaphore Operations
(atomic)
wait(S):
  S.count--;
  if (S.count<0) {
    block this process
    place this process in S.queue
  }
S.count may be initialized to a
nonnegative value (often = 1)