MCPcopy Create free account
hub / github.com/antlr/codebuff / getWaitQueueLength

Method getWaitQueueLength

output/java_guava/1.4.16/Monitor.java:956–966  ·  view source on GitHub ↗

Returns an estimate of the number of threads waiting for the given guard to become satisfied. Note that because timeouts and interrupts may occur at any time, the estimate serves only as an upper bound on the actual number of waiters. This method is designed for use in monitoring of the system state

(Guard guard)

Source from the content-addressed store, hash-verified

954
955
956 public int getWaitQueueLength(Guard guard) {
957 if (guard.monitor != this) {
958 throw new IllegalMonitorStateException();
959 }
960 lock.lock();
961 try {
962 return guard.waiterCount;
963 } finally {
964 lock.unlock();
965 }
966 }
967
968 /**
969 * Returns unit.toNanos(time), additionally ensuring the returned value is not at risk of

Callers 1

hasWaitersMethod · 0.95

Calls 2

lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected