Protecting Locks Against Unbalanced Unlock()
Vivek Shahare, Milind Chabbi, Nikhil Hegde · 2023
The lock is a building-block synchronization primitive that enables mutually exclusive access to shared data in shared-memory parallel programs. Mutual exclusion is typically achieved by guarding the code that accesses the shared data with a pair of lock() and unlock() operations. Concurrency bugs arise when this ordering of operations is violated.