module type THREAD = sig
.. end
The THREAD monad.
type 'a
t
val return : 'a -> 'a t
val bind : 'a t ->
('a -> 'b t) -> 'b t
val fail : exn -> 'a t
val catch : (unit -> 'a t) ->
(exn -> 'a t) -> 'a t
val finalize : (unit -> 'a t) ->
(unit -> unit t) ->
'a t
val sleep : float -> unit t
val auto_yield : float -> unit -> unit t
type
mutex
val create_recursive_mutex : unit -> mutex
Create a recursive mutex that can be locked recursively by the same
* thread; i.e., unlike a regular mutex,
* with_lock m (fun () -> ... with_lock m (fun () -> ... ))
* will not block.
val with_lock : mutex ->
(unit -> 'a t) -> 'a t