Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file platform.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566moduletypeIO=Io.SmoduletypeCLOCK=sig(** A monotonic time source. See {!Mtime_clock} for an OS-dependent
implementation. *)typecountervalcounter:unit->countervalcount:counter->Mtime.spanendmoduletypeSEMAPHORE=sig(** Binary semaphores for mutual exclusion *)typet(** The type of binary semaphore. *)valmake:bool->t(** [make b] returns a new semaphore with the given initial state. If [b] is
[true], the semaphore is initially available for acquisition; otherwise,
the semaphore is initially unavailable. *)valacquire:string->t->unit(** Acquire the given semaphore. Acquisition is not re-entrant. *)valrelease:t->unit(** Release the given semaphore. If any threads are attempting to acquire the
semaphore, exactly one of them will gain access to the semaphore. *)valwith_acquire:string->t->(unit->'a)->'a(** [with_acquire t f] first obtains [t], then computes [f ()], and finally
release [t]. *)valis_held:t->bool(** [is_held t] returns [true] if the semaphore is held, without acquiring
[t]. *)endmoduletypeTHREAD=sig(** Cooperative threads. *)type'at(** The type of thread handles. *)valasync:(unit->'a)->'at(** [async f] creates a new thread of control which executes [f ()] and
returns the corresponding thread handle. The thread terminates whenever
[f ()] returns a value or raises an exception. *)valawait:'at->('a,[`Async_exnofexn])result(** [await t] blocks on the termination of [t]. *)valreturn:'a->'at(** [return ()] is a pre-terminated thread handle. *)valyield:unit->unit(** Re-schedule the calling thread without suspending it. *)endmoduletypeS=sigmoduleIO:IOmoduleSemaphore:SEMAPHOREmoduleThread:THREADmoduleClock:CLOCKend