Package com.sleepycat.je.latch

Examples of com.sleepycat.je.latch.Latch.acquire()


    Lock lookupLock(Long nodeId)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return lookupLockInternal(nodeId, lockTableIndex);
        } finally {
            latch.release();
        }
View Full Code Here


                                  boolean nonBlockingRequest)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return attemptLockInternal(nodeId, locker, type,
                                       nonBlockingRequest, lockTableIndex);
        } finally {
            latch.release();
View Full Code Here

                                         DatabaseImpl database)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return makeTimeoutMsgInternal
                (isLockNotTxnTimeout, locker, nodeId, type, grantType, useLock,
                 timeout, start, now, database);
        } finally {
View Full Code Here

        throws DatabaseException {

        long nid = nodeId;
        int lockTableIndex = getLockTableIndex(nid);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return releaseAndFindNotifyTargetsInternal
                (nodeId, locker, lockTableIndex);
        } finally {
            latch.release();
View Full Code Here

                  boolean demoteToRead)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            transferInternal(nodeId, owningLocker, destLocker,
                             demoteToRead, lockTableIndex);
        } finally {
            latch.release();
View Full Code Here

                          Locker[] destLockers)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            transferMultipleInternal(nodeId, owningLocker,
                                     destLockers, lockTableIndex);
        } finally {
            latch.release();
View Full Code Here

    void demote(long nodeId, Locker locker)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            demoteInternal(nodeId, locker, lockTableIndex);
        } finally {
            latch.release();
        }
View Full Code Here

    boolean isLocked(Long nodeId)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return isLockedInternal(nodeId, lockTableIndex);
        } finally {
            latch.release();
        }
View Full Code Here

    boolean isOwner(Long nodeId, Locker locker, LockType type)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return isOwnerInternal(nodeId, locker, type, lockTableIndex);
        } finally {
            latch.release();
        }
View Full Code Here

    boolean isWaiter(Long nodeId, Locker locker)
        throws DatabaseException {

        int lockTableIndex = getLockTableIndex(nodeId);
        Latch latch = lockTableLatches[lockTableIndex];
        latch.acquire();
        try {
            return isWaiterInternal(nodeId, locker, lockTableIndex);
        } finally {
            latch.release();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.