/** * @see ExclusiveSharedLockObject#attemptLock */ public final boolean attemptLock(final LockMode mode, final int flags, final LockingPolicy lockPolicy, final long msecs, Object owner, final Object context) { if (owner == null) { owner = Thread.currentThread(); } if (mode == LockMode.EX) { return attemptExclusiveLock(flags, lockPolicy, msecs, owner, context); } return attemptSharedLock(mode.getLockModeArg() | flags, lockPolicy, msecs, owner, context); }