Deposit/withdraw lock

How to implement a single-entrant lock using AtomicInteger? A single-entrant lock which uses deposit-withdraw approach of AtomicInteger specification.

General Information

  • Backend: Chalice
  • Language: Java
  • Features: Atomics, Witnesses, Locking
  • Path to Example File: atomics/DWLock.java
  • Should Verify: Yes
  • Date: 2017-06-15
  • Lines of Code: 102 (comments not included)
  • Lines of Specification: 39 (38.2% of total)
  • Computation Time: 13.5 seconds