Changes lock to semaphore to allow multiple threads to acquire and release the lock