Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / stubs / mlton-stubs / signal.sig
CommitLineData
7f918cf1
CE
1(* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
5 *
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
8 *)
9
10signature MLTON_SIGNAL =
11 sig
12 type t
13 type signal = t
14
15 structure Handler:
16 sig
17 type t
18
19 val default: t
20 val handler: (MLtonThread.Runnable.t -> MLtonThread.Runnable.t) -> t
21 val ignore: t
22 val isDefault: t -> bool
23 val isIgnore: t -> bool
24 val simple: (unit -> unit) -> t
25 end
26
27 structure Mask:
28 sig
29 type t
30
31 val all: t
32 val allBut: signal list -> t
33 val block: t -> unit
34 val getBlocked: unit -> t
35 val isMember: t * signal -> bool
36 val none: t
37 val setBlocked: t -> unit
38 val some: signal list -> t
39 val unblock: t -> unit
40 end
41
42 val getHandler: t -> Handler.t
43 val handled: unit -> Mask.t
44 val prof: t
45 val restart: bool ref
46 val setHandler: t * Handler.t -> unit
47 (* suspend m temporarily sets the signal mask to m and suspends until an
48 * unmasked signal is received and handled, and then resets the mask.
49 *)
50 val suspend: Mask.t -> unit
51 val vtalrm: t
52 end