sig
type t = java'util'concurrent'Semaphore java_instance
val make : ?fair:bool -> java_int -> Semaphore.t
val acquire : Semaphore.t -> java_int -> unit
val acquire_uninterruptibly : Semaphore.t -> java_int -> unit
val available_permits : Semaphore.t -> java_int
val drain_permits : Semaphore.t -> java_int
val get_queue_length : Semaphore.t -> java_int
val has_queued_threads : Semaphore.t -> bool
val is_fair : Semaphore.t -> bool
val release : Semaphore.t -> java_int -> unit
val try_acquire : Semaphore.t -> java_int -> bool
val try_acquire_time :
Semaphore.t -> java_int -> java_long -> TimeUnit.t -> bool
val null : Semaphore.t
external is_null : Semaphore.t -> bool = "java is_null"
external is_not_null : Semaphore.t -> bool = "java is_not_null"
val wrap : Semaphore.t -> Semaphore.t option
val unwrap : Semaphore.t option -> Semaphore.t
end