Opaque lockRes.

Lemma invariant_mklock:
forall tp c b ofs  i (cnti: containsThread tp i)
(Hinv: invariant tp)
(Hperm: forall ofs', Intv.In ofs' (ofs, ofs + Z.of_nat lksize.LKSIZE_nat)%Z ->
Mem.perm_order' ((getThreadR cnti)#1 # b ofs') Writable),
let tp' := (updThread cnti c
(setPermBlock (Some Nonempty) b ofs (getThreadR cnti)#1 lksize.LKSIZE_nat,
setPermBlock (Some Writable) b ofs
(getThreadR cnti)#2 lksize.LKSIZE_nat)) in
invariant tp'.