make ~fair:f p returns a new semaphore with p permits, f
indicating whether a fair ordering policy is requested
(defaulting to false); see
Semaphore(...) .
p can be negative, meaning that permits should be released before
any acquisition.acquire s p acquires p permits from semaphore s, blocking until
they are available; see
acquire(...) .Java_exception if p is negativeJava_exception if the thread is interruptedacquire_uninterruptibly s p is similar to acquire s p, except
that waiting thread cannot be interrupted; see
acquireUninterruptibly(...) .Java_exception if p is negativerelease s p releases p permits from semaphore s; see
release(...) .Java_exception if p is negativetry_acquire s p is similar to acquire s p, except the function
always returns immediately returning true if acquisition was
successful; see
tryAcquire(...) .Java_exception if p is negativetry_acquire_time s p t u is similar to try_acquire s p, except
that the current thread will at most wait for t (time value whose
unit is u); see
tryAcquire(...) .Java_exception if p is negativeJava_exception if the thread is interrupted