Allows locks to act as semaphores