protected Lock tryLockForWrite ( long time , TimeUnit unit ) throws InterruptedException { if ( time < 0 || unit == null ) { return tryLockForWrite ( ) ; } Lock lock = writeLock ( ) ; return lock . tryLock ( time , unit ) ? lock : null ; }
Try to lock the BO for write .