llbe:
Looks like isLocked() will release the lock if locked. LOCK_EX → LOCK_SH → LOCK_UN.
Huliek:
You are right, though it is not common to check a lock which you locked in your own process.
I would have to add a boolean property "lockedBySelf" if I wanted to fix this, I suppose?
llbe:
Yes, a property should replace the need of LOCK_SH.
The issue I see is that it is not expected that isLocked() changes anything.