Search in sources :

Example 1 with SimpleHeldLocksToken

use of com.palantir.lock.SimpleHeldLocksToken in project atlasdb by palantir.

the class LockServiceImpl method unlockSimple.

@Override
public boolean unlockSimple(SimpleHeldLocksToken token) {
    Preconditions.checkNotNull(token);
    LockDescriptor fakeLockDesc = StringLockDescriptor.of("unlockSimple");
    SortedLockCollection<LockDescriptor> fakeLockSet = LockCollections.of(ImmutableSortedMap.of(fakeLockDesc, LockMode.READ));
    return unlock(new HeldLocksToken(token.getTokenId(), LockClient.ANONYMOUS, token.getCreationDateMs(), 0L, fakeLockSet, maxAllowedLockTimeout, 0L, "UnknownThread-unlockSimple"));
}
Also used : LockDescriptor(com.palantir.lock.LockDescriptor) StringLockDescriptor(com.palantir.lock.StringLockDescriptor) HeldLocksToken(com.palantir.lock.HeldLocksToken) SimpleHeldLocksToken(com.palantir.lock.SimpleHeldLocksToken)

Aggregations

HeldLocksToken (com.palantir.lock.HeldLocksToken)1 LockDescriptor (com.palantir.lock.LockDescriptor)1 SimpleHeldLocksToken (com.palantir.lock.SimpleHeldLocksToken)1 StringLockDescriptor (com.palantir.lock.StringLockDescriptor)1