private boolean writeLockAvailable ( int type ) { if ( mReadLocks == 0 && mWriteLockHeld == null ) { return ( type == UPGRADABLE ) ? true : mUpgradableLockHeld == null ; } return false ; }
Caller must be synchronized .