public void acquireLock ( Object key , boolean exclusive ) { ReentrantReadWriteLock lock = getLock ( key ) ; if ( exclusive ) { lock . writeLock ( ) . lock ( ) ; if ( trace ) log . tracef ( "WL acquired for '%s'" , key ) ; } else { lock . readLock ( ) . lock ( ) ; if ( trace ) log . tracef ( "RL acquired for '%s'" , key ) ; } }
Blocks until a lock is acquired .