| 1 | (* scheduler-hooks.sig\r |
| 2 | * 2004 Matthew Fluet (mfluet@acm.org)\r |
| 3 | * Ported to MLton threads.\r |
| 4 | *)\r |
| 5 | \r |
| 6 | (* scheduler.sml\r |
| 7 | *\r |
| 8 | * COPYRIGHT (c) 1995 AT&T Bell Laboratories.\r |
| 9 | * COPYRIGHT (c) 1989-1991 John H. Reppy\r |
| 10 | *)\r |
| 11 | \r |
| 12 | signature SCHEDULER_HOOKS =\r |
| 13 | sig\r |
| 14 | type 'a thread = 'a RepTypes.thread\r |
| 15 | type rdy_thread = RepTypes.rdy_thread\r |
| 16 | \r |
| 17 | (* this hook gets invoked when the scheduler has nothing else to do;\r |
| 18 | * it is invoked in an atomic region\r |
| 19 | *)\r |
| 20 | val pauseHook : (unit -> rdy_thread) ref\r |
| 21 | \r |
| 22 | (* this hook points to a thread that gets invoked when\r |
| 23 | * the system is otherwise deadlocked. It takes two arguments:\r |
| 24 | * the first is a boolean flag that says weather to do clean-up,\r |
| 25 | * and the second is the exit status.\r |
| 26 | *)\r |
| 27 | val shutdownHook : (bool * OS.Process.status) thread ref\r |
| 28 | \r |
| 29 | val reset : unit -> unit\r |
| 30 | end\r |