Semaphore.CountingA counting semaphore.
val make : ?padded:bool -> int -> tmake initial creates a new counting semaphore with the given initial count.
val release : t -> unitrelease semaphore increments the count of the semaphore.
âšī¸ This operation is not cancelable.
val acquire : t -> unitacquire semaphore waits until the count of the semaphore is greater than 0 and then atomically decrements the count.
val try_acquire : t -> booltry_acquire semaphore attempts to atomically decrement the count of the semaphore unless the count is already 0.
val get_value : t -> intget_value semaphore returns the current count of the semaphore. This should only be used for debugging or informational messages.