@@ -33,8 +33,8 @@ module type S =
33
33
the state when following conditional guards. *)
34
34
val write_global : ?invariant : bool -> Q .ask -> (V .t -> G .t ) -> (V .t -> G .t -> unit ) -> relation_components_t -> varinfo -> varinfo -> relation_components_t
35
35
36
- val lock : Q .ask -> (V .t -> G .t ) -> relation_components_t -> LockDomain.Addr .t -> relation_components_t
37
- val unlock : Q .ask -> (V .t -> G .t ) -> (V .t -> G .t -> unit ) -> relation_components_t -> LockDomain.Addr .t -> relation_components_t
36
+ val lock : Q .ask -> (V .t -> G .t ) -> relation_components_t -> LockDomain.MustLock .t -> relation_components_t
37
+ val unlock : Q .ask -> (V .t -> G .t ) -> (V .t -> G .t -> unit ) -> relation_components_t -> LockDomain.MustLock .t -> relation_components_t
38
38
39
39
val sync : Q .ask -> (V .t -> G .t ) -> (V .t -> G .t -> unit ) -> relation_components_t -> [`Normal | `Join | `JoinCall | `Return | `Init | `Thread ] -> relation_components_t
40
40
@@ -483,7 +483,7 @@ struct
483
483
484
484
let startstate () = ()
485
485
486
- let atomic_mutex = LockDomain.Addr . of_var LibraryFunctions. verifier_atomic_var
486
+ let atomic_mutex = LockDomain.MustLock . of_var LibraryFunctions. verifier_atomic_var
487
487
488
488
let get_m_with_mutex_inits ask getg m =
489
489
let get_m = getg (V. mutex m) in
@@ -589,9 +589,9 @@ struct
589
589
let write_escape = write_global_internal ~skip_meet: true
590
590
591
591
let lock ask getg (st : relation_components_t ) m =
592
- let atomic = Param. handle_atomic && LockDomain.Addr . equal m ( atomic_mutex) in
592
+ let atomic = Param. handle_atomic && LockDomain.MustLock . equal m atomic_mutex in
593
593
(* TODO: somehow actually unneeded here? *)
594
- if not atomic && Locksets. (not (Lockset . mem m (current_lockset ask))) then (
594
+ if not atomic && Locksets. (not (MustLockset . mem m (current_lockset ask))) then (
595
595
let rel = st.rel in
596
596
let get_m = get_m_with_mutex_inits ask getg m in
597
597
(* Additionally filter get_m in case it contains variables it no longer protects. E.g. in 36/22. *)
@@ -604,7 +604,7 @@ struct
604
604
st (* sound w.r.t. recursive lock *)
605
605
606
606
let unlock ask getg sideg (st : relation_components_t ) m : relation_components_t =
607
- let atomic = Param. handle_atomic && LockDomain.Addr . equal m ( atomic_mutex) in
607
+ let atomic = Param. handle_atomic && LockDomain.MustLock . equal m atomic_mutex in
608
608
let rel = st.rel in
609
609
if not atomic then (
610
610
let rel_side = keep_only_protected_globals ask m rel in
@@ -721,7 +721,7 @@ module type ClusterArg = functor (RD: RelationDomain.RD) ->
721
721
sig
722
722
module LRD : Lattice .S
723
723
724
- val keep_only_protected_globals : Q .ask -> LockDomain.Addr .t -> LRD .t -> LRD .t
724
+ val keep_only_protected_globals : Q .ask -> LockDomain.MustLock .t -> LRD .t -> LRD .t
725
725
val keep_global : varinfo -> LRD .t -> LRD .t
726
726
727
727
val lock : RD .t -> LRD .t -> LRD .t -> RD .t
@@ -980,7 +980,7 @@ struct
980
980
981
981
let get_m_with_mutex_inits inits ask getg m =
982
982
let get_m = get_relevant_writes ask m (G. mutex @@ getg (V. mutex m)) in
983
- if M. tracing then M. traceli " relationpriv" " get_m_with_mutex_inits %a\n get=%a" LockDomain.Addr . pretty m LRD. pretty get_m;
983
+ if M. tracing then M. traceli " relationpriv" " get_m_with_mutex_inits %a\n get=%a" LockDomain.MustLock . pretty m LRD. pretty get_m;
984
984
let r =
985
985
if not inits then
986
986
get_m
@@ -993,7 +993,7 @@ struct
993
993
if M. tracing then M. traceu " relationpriv" " -> %a" LRD. pretty r;
994
994
r
995
995
996
- let atomic_mutex = LockDomain.Addr . of_var LibraryFunctions. verifier_atomic_var
996
+ let atomic_mutex = LockDomain.MustLock . of_var LibraryFunctions. verifier_atomic_var
997
997
998
998
let get_mutex_global_g_with_mutex_inits inits ask getg g =
999
999
let get_mutex_global_g =
@@ -1106,8 +1106,8 @@ struct
1106
1106
{rel = rel_local; priv = (W. add g w,lmust,l)} (* Keep write local as if it were protected by the atomic section. *)
1107
1107
1108
1108
let lock ask getg (st : relation_components_t ) m =
1109
- let atomic = Param. handle_atomic && LockDomain.Addr . equal m ( atomic_mutex) in
1110
- if not atomic && Locksets. (not (Lockset . mem m (current_lockset ask))) then (
1109
+ let atomic = Param. handle_atomic && LockDomain.MustLock . equal m atomic_mutex in
1110
+ if not atomic && Locksets. (not (MustLockset . mem m (current_lockset ask))) then (
1111
1111
let rel = st.rel in
1112
1112
let _,lmust,l = st.priv in
1113
1113
let lm = LLock. mutex m in
@@ -1130,7 +1130,7 @@ struct
1130
1130
RD. keep_filter oct protected
1131
1131
1132
1132
let unlock ask getg sideg (st : relation_components_t ) m : relation_components_t =
1133
- let atomic = Param. handle_atomic && LockDomain.Addr . equal m ( atomic_mutex) in
1133
+ let atomic = Param. handle_atomic && LockDomain.MustLock . equal m atomic_mutex in
1134
1134
let rel = st.rel in
1135
1135
let w,lmust,l = st.priv in
1136
1136
if not atomic then (
@@ -1314,7 +1314,7 @@ struct
1314
1314
r
1315
1315
1316
1316
let lock ask getg st m =
1317
- if M. tracing then M. traceli " relationpriv" " lock %a" LockDomain.Addr . pretty m;
1317
+ if M. tracing then M. traceli " relationpriv" " lock %a" LockDomain.MustLock . pretty m;
1318
1318
if M. tracing then M. trace " relationpriv" " st: %a" RelComponents. pretty st;
1319
1319
let getg x =
1320
1320
let r = getg x in
@@ -1326,7 +1326,7 @@ struct
1326
1326
r
1327
1327
1328
1328
let unlock ask getg sideg st m =
1329
- if M. tracing then M. traceli " relationpriv" " unlock %a" LockDomain.Addr . pretty m;
1329
+ if M. tracing then M. traceli " relationpriv" " unlock %a" LockDomain.MustLock . pretty m;
1330
1330
if M. tracing then M. trace " relationpriv" " st: %a" RelComponents. pretty st;
1331
1331
let getg x =
1332
1332
let r = getg x in
0 commit comments