equal
deleted
inserted
replaced
10 val start: unit -> Document_ID.execution |
10 val start: unit -> Document_ID.execution |
11 val discontinue: unit -> unit |
11 val discontinue: unit -> unit |
12 val is_running: Document_ID.execution -> bool |
12 val is_running: Document_ID.execution -> bool |
13 val running: Document_ID.execution -> Document_ID.exec -> bool |
13 val running: Document_ID.execution -> Document_ID.exec -> bool |
14 val finished: Document_ID.exec -> unit |
14 val finished: Document_ID.exec -> unit |
15 val peek: Document_ID.exec -> Future.group option |
15 val cancel: Document_ID.exec -> unit |
|
16 val terminate: Document_ID.exec -> unit |
16 val snapshot: unit -> Future.group list |
17 val snapshot: unit -> Future.group list |
17 end; |
18 end; |
18 |
19 |
19 structure Execution: EXECUTION = |
20 structure Execution: EXECUTION = |
20 struct |
21 struct |
56 Synchronized.change state |
57 Synchronized.change state |
57 (apsnd (fn execs => |
58 (apsnd (fn execs => |
58 Inttab.delete exec_id execs handle Inttab.UNDEF bad => |
59 Inttab.delete exec_id execs handle Inttab.UNDEF bad => |
59 error ("Attempt to finish unknown execution " ^ Document_ID.print bad))); |
60 error ("Attempt to finish unknown execution " ^ Document_ID.print bad))); |
60 |
61 |
61 fun peek exec_id = |
62 fun peek_list exec_id = |
62 Inttab.lookup (snd (Synchronized.value state)) exec_id; |
63 the_list (Inttab.lookup (snd (Synchronized.value state)) exec_id); |
|
64 |
|
65 fun cancel exec_id = List.app Future.cancel_group (peek_list exec_id); |
|
66 fun terminate exec_id = List.app Future.terminate (peek_list exec_id); |
63 |
67 |
64 fun snapshot () = |
68 fun snapshot () = |
65 Inttab.fold (cons o #2) (snd (Synchronized.value state)) []; |
69 Inttab.fold (cons o #2) (snd (Synchronized.value state)) []; |
66 |
70 |
67 end; |
71 end; |