minor fixes

pull/282/head
Nikita 9 years ago
parent 1ceb5a1a1c
commit 161dd1c2d2

@ -97,9 +97,9 @@ public class RedissonCountDownLatch extends RedissonObject implements RCountDown
@Override @Override
public boolean onStatus(PubSubType type, String channel) { public boolean onStatus(PubSubType type, String channel) {
if (channel.equals(getChannelName()) && !value.getPromise().isSuccess() if (channel.equals(getChannelName())
&& type == PubSubType.SUBSCRIBE) { && type == PubSubType.SUBSCRIBE) {
value.getPromise().setSuccess(value); value.getPromise().trySuccess(value);
return true; return true;
} }
return false; return false;

@ -104,9 +104,8 @@ public class RedissonLock extends RedissonExpirable implements RLock {
@Override @Override
public boolean onStatus(PubSubType type, String channel) { public boolean onStatus(PubSubType type, String channel) {
if (channel.equals(getChannelName()) if (channel.equals(getChannelName())
&& !value.getPromise().isSuccess()
&& type == PubSubType.SUBSCRIBE) { && type == PubSubType.SUBSCRIBE) {
value.getPromise().setSuccess(value); value.getPromise().trySuccess(value);
return true; return true;
} }
return false; return false;
@ -161,7 +160,7 @@ public class RedissonLock extends RedissonExpirable implements RLock {
} }
Future<RedissonLockEntry> future = subscribe(); Future<RedissonLockEntry> future = subscribe();
future.awaitUninterruptibly(); future.syncUninterruptibly();
try { try {
while (true) { while (true) {

Loading…
Cancel
Save