AsyncSemaphore.queueSize method added

pull/727/head
Nikita 8 years ago
parent dc8b5db505
commit a129961a5b

@ -48,17 +48,10 @@ public class AsyncSemaphore {
Thread.currentThread().interrupt();
}
}
public boolean tryAcquire() {
public int queueSize() {
synchronized (this) {
if (counter == 0) {
return false;
}
if (counter > 0) {
counter--;
return true;
}
throw new IllegalStateException();
return listeners.size();
}
}

Loading…
Cancel
Save