|
|
|
@ -212,7 +212,7 @@ public class RedissonLock extends RedissonBaseLock {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<T> RFuture<T> tryLockInnerAsync(long waitTime, long leaseTime, TimeUnit unit, long threadId, RedisStrictCommand<T> command) {
|
|
|
|
|
return evalWriteAsync(getRawName(), LongCodec.INSTANCE, command,
|
|
|
|
|
return evalWriteSyncedAsync(getRawName(), LongCodec.INSTANCE, command,
|
|
|
|
|
"if ((redis.call('exists', KEYS[1]) == 0) " +
|
|
|
|
|
"or (redis.call('hexists', KEYS[1], ARGV[2]) == 1)) then " +
|
|
|
|
|
"redis.call('hincrby', KEYS[1], ARGV[2], 1); " +
|
|
|
|
@ -335,7 +335,7 @@ public class RedissonLock extends RedissonBaseLock {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected RFuture<Boolean> unlockInnerAsync(long threadId, String requestId, int timeout) {
|
|
|
|
|
return evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
|
|
|
|
|
return evalWriteSyncedAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
|
|
|
|
|
"local val = redis.call('get', KEYS[3]); " +
|
|
|
|
|
"if val ~= false then " +
|
|
|
|
|
"return tonumber(val);" +
|
|
|
|
|