public void releaseLock ( Object key ) { ReentrantReadWriteLock lock = getLock ( key ) ; if ( lock . isWriteLockedByCurrentThread ( ) ) { lock . writeLock ( ) . unlock ( ) ; if ( trace ) log . tracef ( "WL released for '%s'" , key ) ; } else { lock . readLock ( ) . unlock ( ) ; if ( trace ) log . tracef ( "RL released for '%s'" , key ) ; } }
Releases a lock the caller may be holding . This method is idempotent .