Instance CompSpecs : compspecs.Definition Vprog : varspecs.Definition acquire_spec := DECLARE _acquire acquire_spec.Definition release_spec := DECLARE _release release_spec.Definition makelock_spec := DECLARE _makelock (makelock_spec _).Definition freelock_spec := DECLARE _freelock (freelock_spec _).Definition spawn_spec := DECLARE _spawn spawn_spec.Definition freelock2_spec := DECLARE _freelock2 (freelock2_spec _).Definition release2_spec := DECLARE _release2 release2_spec.Definition thread_lock_R sh g1 g2 ctr lockc :=
  lock_inv sh lockc (cptr_lock_inv g1 g2 ctr) * ghost_var gsh2 1 g1.Definition thread_lock_inv sh g1 g2 ctr lockc lockt :=
  selflock (thread_lock_R sh g1 g2 ctr lockc) sh lockt.

(* Specifications: *)
Lemma ctr_inv_exclusive : forall g1 g2 p, exclusive_mpred (cptr_lock_inv g1 g2 p).
Lemma thread_inv_exclusive : forall sh g1 g2 ctr lock lockt, exclusive_mpred (thread_lock_inv sh g1 g2 ctr lock lockt).
Lemma body_incr: semax_body Vprog Gprog f_incr incr_spec.
Lemma body_read : semax_body Vprog Gprog f_read read_spec.
Lemma body_thread_func : semax_body Vprog Gprog f_thread_func thread_func_spec.