module Lock:sig
..end
type
t
val make_reentrant : bool -> t
val lock : t -> unit
val lock_interruptibly : t -> unit
lock
, except that some other thread may interrupt the
current thread while blocked.
Raises Runtime.Interrupted
if the thread is interrupted.
val new_condition : t -> Condition.t
val try_lock : t -> bool
true
. Otherwise,
immediately returns false
.val try_lock_time : t -> int64 -> TimeUnit.t -> bool
try_lock_time l t u
is similar to lock_interruptibly l
, except
that the current thread will at most wait for t
(time value whose
unit is u
). Returns whether the lock was acquired.
Raises Runtime.Interrupted
if the thread is interrupted.
val unlock : t -> unit
Raises Invalid_argument
if the current thread does not hold the
lock.