OK.
Wrt the patch, shouldn't the call to wait() in LockGate#waitForPermission be outside the synchronized block to allow other threads to carry on with their business, including calling LockGate#freePermission?
OK.
Wrt the patch, shouldn't the call to wait() in LockGate#waitForPermission be outside the synchronized block to allow other threads to carry on with their business, including calling LockGate#freePermission?