|
|
@ -491,16 +491,18 @@ public class RedissonSemaphore extends RedissonExpirable implements RSemaphore {
|
|
|
|
public void reducePermits(int permits) {
|
|
|
|
public void reducePermits(int permits) {
|
|
|
|
get(reducePermitsAsync(permits));
|
|
|
|
get(reducePermitsAsync(permits));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public RFuture<Void> reducePermitsAsync(int permits) {
|
|
|
|
public RFuture<Void> reducePermitsAsync(int permits) {
|
|
|
|
return addPermitsAsync(-permits);
|
|
|
|
return addPermitsAsync(-permits);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void addPermits(int permits) {
|
|
|
|
public void addPermits(int permits) {
|
|
|
|
get(reducePermitsAsync(permits));
|
|
|
|
get(addPermitsAsync(permits));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public RFuture<Void> addPermitsAsync(int permits) {
|
|
|
|
public RFuture<Void> addPermitsAsync(int permits) {
|
|
|
|
return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_VOID,
|
|
|
|
return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_VOID,
|
|
|
|
"local value = redis.call('get', KEYS[1]); " +
|
|
|
|
"local value = redis.call('get', KEYS[1]); " +
|
|
|
|