src/Pure/ML-Systems/multithreading.ML
changeset 59054 61b723761dff
parent 54717 42c209a6c225
child 59180 c0fa3b3bdabd
equal deleted inserted replaced
59053:43e07797269b 59054:61b723761dff
    29   val trace: int ref
    29   val trace: int ref
    30   val tracing: int -> (unit -> string) -> unit
    30   val tracing: int -> (unit -> string) -> unit
    31   val tracing_time: bool -> Time.time -> (unit -> string) -> unit
    31   val tracing_time: bool -> Time.time -> (unit -> string) -> unit
    32   val real_time: ('a -> unit) -> 'a -> Time.time
    32   val real_time: ('a -> unit) -> 'a -> Time.time
    33   val self_critical: unit -> bool
    33   val self_critical: unit -> bool
       
    34   val synchronized: string -> Mutex.mutex -> (unit -> 'a) -> 'a
    34   val serial: unit -> int
    35   val serial: unit -> int
    35 end;
    36 end;
    36 
    37 
    37 structure Multithreading: MULTITHREADING =
    38 structure Multithreading: MULTITHREADING =
    38 struct
    39 struct
    72 
    73 
    73 fun self_critical () = false;
    74 fun self_critical () = false;
    74 fun NAMED_CRITICAL _ e = e ();
    75 fun NAMED_CRITICAL _ e = e ();
    75 fun CRITICAL e = e ();
    76 fun CRITICAL e = e ();
    76 
    77 
       
    78 fun synchronized _ _ e = e ();
       
    79 
    77 
    80 
    78 (* serial numbers *)
    81 (* serial numbers *)
    79 
    82 
    80 local val count = ref (0: int)
    83 local val count = ref (0: int)
    81 in fun serial () = (count := ! count + 1; ! count) end;
    84 in fun serial () = (count := ! count + 1; ! count) end;