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

Method getWaitQueueLength

output/java_guava/1.4.19/Monitor.java:954–964  ·  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

952
953
954 public int getWaitQueueLength(Guard guard) {
955 if (guard.monitor != this) {
956 throw new IllegalMonitorStateException();
957 }
958 lock.lock();
959 try {
960 return guard.waiterCount;
961 } finally {
962 lock.unlock();
963 }
964 }
965
966 /**
967 * 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