module Rw_mutex:Read/write mutexessig..end
type 'a t
typepref =[ `NoPref | `Readers | `Writers ]
Read/write mutexes
Author(s): Markus Mottl
type 'a kind
val r_pref : [ `Readers ] kindr_pref preference kind for readers.val w_pref : [ `Writers ] kindw_pref preference kind for writers.val np_pref : [ `NoPref ] kindnp_pref no preference for readers or writers.val create : 'a kind -> 'a tcreate prefpref.val r_lock : [< pref ] t -> unitr_lock mtx locks mtx for a reader.val r_unlock : [< pref ] t -> unitr_unlock mtx unlocks mtx for a reader.val w_lock : [< pref ] t -> unitw_lock mtx locks mtx for a writer.val w_unlock : [< pref ] t -> unitw_unlock mtx unlocks mtx for a writer.val try_r_lock : [< pref ] t -> booltry_r_lock mtx tries to lock mtx for a reader without blocking.true iff mtx could be locked, false otherwise.val try_w_lock : [< pref ] t -> booltry_w_lock mtx tries to lock mtx for a writer without blocking.true iff mtx could be locked, false otherwise.val wrap_r_lock : [< pref ] t -> (unit -> 'a) -> 'awrap_r_lock mtx f locks mtx for a reader, executes f and
unlocks the mutex again.f.val try_wrap_r_lock : [< pref ] t -> (unit -> 'a) -> 'a optiontry_wrap_r_lock mtx f tries to lock mtx for a reader without
blocking, executes f and unlocks the mutex again.Some
res, where res is the result of f, iff the mutex could be locked,
None otherwise.val btry_wrap_r_lock : [< pref ] t -> (unit -> unit) -> boolbtry_wrap_r_lock mtx f tries to lock mtx for a reader without
blocking, executes f and unlocks the mutex again.true
iff the mutex could be locked, false otherwise.val wrap_w_lock : [< pref ] t -> (unit -> 'a) -> 'awrap_w_lock mtx f locks mtx for a writer, executes f and
unlocks the mutex again.f.val try_wrap_w_lock : [< pref ] t -> (unit -> 'a) -> 'a optiontry_wrap_w_lock mtx f tries to lock mtx for a writer without
blocking, executes f and unlocks the mutex again.Some
res, where res is the result of f, iff the mutex could be locked,
None otherwise.val btry_wrap_w_lock : [< pref ] t -> (unit -> unit) -> boolbtry_wrap_w_lock mtx f tries to lock mtx for a writer without
blocking, executes f and unlocks the mutex again.true
iff the mutex could be locked, false otherwise.