Logo Search packages:      
Sourcecode: libjgroups-java version File versions

boolean org::jgroups::blocks::DistributedLockManager::localRelease ( LockDecree  lockDecree  )  [inline, private]

Releases lock locally.

Parameters:
lockDecree instance of LockDecree describing the lock.

Definition at line 184 of file DistributedLockManager.java.

References org::jgroups::blocks::DistributedLockManager::LockDecree::getKey(), localLock(), removeExpired(), and org::jgroups::blocks::DistributedLockManager::LockDecree::requester.

Referenced by commit().

                                                        {
        // remove expired locks
        removeExpired(lockDecree);

        LockDecree localLock=
                (LockDecree) heldLocks.get(lockDecree.getKey());

        if(localLock == null) {
            // no lock exist
            return true;
        }
        else if(localLock.requester.equals(lockDecree.requester)) {
            // requester owns the lock, release the lock
            heldLocks.remove(lockDecree.getKey());
            return true;
        }
        else
        // lock does not belong to requester
            return false;
    }


Generated by  Doxygen 1.6.0   Back to index