Function: SB-THREAD:TRY-SEMAPHORE

package type github

Try to decrement the count of SEMAPHORE by N. If the count were to become negative, punt and return NIL, otherwise return the new count of SEMAPHORE.

If NOTIFICATION is given it must be a semaphore notification object with SEMAPHORE-NOTIFICATION-STATUS of NIL. If the count is decremented, the status is set to T.

Lambda list

(sb-thread:semaphore &optional sb-thread::n sb-thread::notification)