Backport from sid to buster
[hcoop/debian/mlton.git] / lib / cml / core-cml / timeout.sig
1 (* timeout.sig
2 * 2004 Matthew Fluet (mfluet@acm.org)
3 * Ported to MLton threads.
4 *)
5
6 (* timeout-sig.sml
7 *
8 * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
9 * COPYRIGHT (c) 1989-1991 John H. Reppy
10 *
11 * Exported interface for timeout synchronization.
12 *)
13
14 signature TIME_OUT =
15 sig
16 val timeOutEvt : Time.time -> unit Event.event
17 val atTimeEvt : Time.time -> unit Event.event
18 end
19
20 signature TIME_OUT_EXTRA =
21 sig
22 include TIME_OUT
23
24 val reset : unit -> unit
25 (* preepmt () == NONE ==> no waiting threads
26 * preepmt () == SOME NONE ==> enqueued a waiting thread
27 * preepmt () == SOME (SOME t) ==> a waiting thread will be ready in t time
28 *)
29 val preempt : unit -> Time.time option option
30 end