| author | wenzelm |
| Sun, 13 Mar 2016 12:44:24 +0100 | |
| changeset 62612 | cf48f41a9278 |
| parent 62508 | d0b68218ea55 |
| permissions | -rw-r--r-- |
|
62508
d0b68218ea55
discontinued RAW session: bootstrap directly from isabelle_process RAW_ML_SYSTEM;
wenzelm
parents:
62493
diff
changeset
|
1 |
(* Title: Pure/General/secure.ML |
| 20925 | 2 |
Author: Makarius |
3 |
||
4 |
Secure critical operations. |
|
5 |
*) |
|
6 |
||
7 |
signature SECURE = |
|
8 |
sig |
|
| 20977 | 9 |
val set_secure: unit -> unit |
| 20925 | 10 |
val is_secure: unit -> bool |
| 62493 | 11 |
val deny: string -> unit |
12 |
val deny_ml: unit -> unit |
|
| 20925 | 13 |
end; |
14 |
||
15 |
structure Secure: SECURE = |
|
16 |
struct |
|
17 |
||
| 32738 | 18 |
val secure = Unsynchronized.ref false; |
| 20925 | 19 |
|
| 20977 | 20 |
fun set_secure () = secure := true; |
| 20925 | 21 |
fun is_secure () = ! secure; |
22 |
||
| 62493 | 23 |
fun deny msg = if is_secure () then error msg else (); |
| 20992 | 24 |
|
| 62493 | 25 |
fun deny_ml () = deny "Cannot evaluate ML source in secure mode"; |
|
23922
707639e9497d
marked some CRITICAL sections (for multithreading);
wenzelm
parents:
22567
diff
changeset
|
26 |
|
| 20925 | 27 |
end; |