(*Some (ThreadPool.getThreadR Htid, virtue1)*)
(*Some virtue2*)

Lemma acquire_fail_step_diagram:
forall (U : list nat) (tr1 tr2 : HybridMachineSig.event_trace)
(st1' : ThreadPool (Some hb)) (m1' : mem)
(tid : nat) (cd : option compiler_index)
(st2 : ThreadPool (Some (S hb))) (mu : meminj)
(m2 : mem) (Htid : ThreadPool.containsThread st1' tid)
(b : block) (ofs : Integers.Ptrofs.int)
(c : semC) (Hcmpt : mem_compatible st1' m1'),
concur_match cd mu st1' m1' st2 m2 ->
List.Forall2 (inject_mevent mu) tr1 tr2 ->
HybridMachineSig.schedPeek U = Some tid ->
semantics.at_external
(semantics.csem (event_semantics.msem semSem)) c
(restrPermMap (fst (ssrfun.pair_of_and (Hcmpt tid Htid)))) =
Some (LOCK, (Vptr b ofs :: nil)%list) ->
Mem.load AST.Mint32
(restrPermMap (snd (ssrfun.pair_of_and (Hcmpt tid Htid)))) b
(Integers.Ptrofs.intval ofs) = Some (Vint Integers.Int.zero) ->
Mem.range_perm
(restrPermMap (snd (ssrfun.pair_of_and (Hcmpt tid Htid)))) b
(Integers.Ptrofs.intval ofs)
(BinInt.Z.add (Integers.Ptrofs.intval ofs) LKSIZE) Cur Readable ->
ThreadPool.getThreadC Htid = Kblocked c ->
invariant st1' ->
exists
e' (st2' : t) (m2' : mem) (cd' : option compiler_index)
(mu' : meminj),
concur_match cd' mu' st1' m1' st2' m2' /\
List.Forall2 (inject_mevent mu') (seq.cat tr1 (Events.external tid (Events.failacq (b, Integers.Ptrofs.intval ofs)) :: nil))
(seq.cat tr2 (Events.external tid e' :: nil)) /\
HybridMachineSig.external_step
(scheduler:=HybridMachineSig.HybridCoarseMachine.scheduler)
U tr2 st2 m2
(HybridMachineSig.schedSkip U)
(seq.cat tr2 (Events.external tid e' :: nil))
st2' m2'.