@ -487,16 +487,6 @@ public class RedissonSemaphore extends RedissonExpirable implements RSemaphore {
Arrays.<Object>asList(getName(), getChannelName()), permits);
}
@Override
public void reducePermits(int permits) {
get(reducePermitsAsync(permits));
public RFuture<Void> reducePermitsAsync(int permits) {
return addPermitsAsync(-permits);
public void addPermits(int permits) {
get(addPermitsAsync(permits));
@ -124,12 +124,6 @@ public interface RSemaphore extends RExpirable, RSemaphoreAsync {
*/
boolean trySetPermits(int permits);
/*
* Use addPermits instead
@Deprecated
void reducePermits(int permits);
/**
* Increases or decreases the number of available permits by defined value.
*
@ -110,12 +110,6 @@ public interface RSemaphoreAsync extends RExpirableAsync {
RFuture<Boolean> tryAcquireAsync(int permits, long waitTime, TimeUnit unit);
RFuture<Void> reducePermitsAsync(int permits);
@ -56,7 +56,7 @@ public class RedissonSemaphoreTest extends BaseConcurrentTest {
s.trySetPermits(10);
s.acquire(10);
s.reducePermits(5);
s.addPermits(-5);
assertThat(s.availablePermits()).isEqualTo(-5);
s.release(10);
assertThat(s.availablePermits()).isEqualTo(5);