Skip to content
Snippets Groups Projects
Commit fb244ed3 authored by Ralf Jung's avatar Ralf Jung
Browse files

MutexGuard Sync bound

parent fcde5d93
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -88,9 +88,18 @@ Section mguard. ...@@ -88,9 +88,18 @@ Section mguard.
Global Instance mutexguard_ne α : NonExpansive (mutexguard α). Global Instance mutexguard_ne α : NonExpansive (mutexguard α).
Proof. apply type_contractive_ne, _. Qed. Proof. apply type_contractive_ne, _. Qed.
(* TODO: compat with lft_incl and eqtype. (* TODO: compat with lft_incl and eqtype. *)
MutexGuard is Sync if T is Send. *)
Global Instance mutexguard_sync α ty :
Sync ty Sync (mutexguard α ty).
Proof.
move=>?????/=. apply uPred.exist_mono=>?. do 6 f_equiv.
by rewrite sync_change_tid.
Qed.
(* POSIX requires the unlock to occur from the thread that acquired
the lock, so Rust does not implement Send for RwLockWriteGuard. We could
prove this. *)
End mguard. End mguard.
Section code. Section code.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment