Module Tjr_mem_queue.Memq_intf
Mem_queue interfaces; don't open
type ('mutex, 'cvar, 'msg) memq
=
{
q : 'msg Stdlib.Queue.t;
mutable!!!
mutex : 'mutex;
cvar : 'cvar;
}
The queue of messages. NOTE the q field contains a MUTABLE queue
type ('msg, 'q, 't) memq_ops
=
{
memq_enqueue : msg:'msg -> q:'q -> (unit, 't) Tjr_monad.m;
memq_dequeue : 'q -> ('msg, 't) Tjr_monad.m;
memq_create : unit -> ('q, 't) Tjr_monad.m;
FIXME?
}
FIXME for initialization purposes, we may also want a non-monadic "create" operation; at the moment it is in the monad because mutexes and references are part of the semantic state, as see in mutex ops
class type ['msg, 't] memq_as_obj = object ... end