module Factory:
Parameters: |
|
type
condition
Type of a condition, used in wait
and broadcast
val create : unit -> condition
Create a condition. Implementation-wise,
a duppy task is created that will be used to select a
waiting computation, and resume it.
Thus, priority
and s
represents, resp., the priority
and scheduler used when running calling process' computation.
val wait : condition ->
Mutex.mutex -> (unit, 'a) Duppy.Monad.t
wait h m
is a computation that:
m
Condition.signal c
or Condition.broadcast c
has been calledm
unit
val broadcast : condition -> (unit, 'a) Duppy.Monad.t
broadcast c
is a computation that
resumes all computations waiting on c
. It should
return immediately.
val signal : condition -> (unit, 'a) Duppy.Monad.t
signal c
is a computation that resumes one
computation waiting on c
. It should return
immediately.