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

Method awaitNanos

output/java_guava/1.4.17/Monitor.java:1164–1187  ·  view source on GitHub ↗

Caller should check before calling that guard is not satisfied.

(Guard guard, long nanos, boolean signalBeforeWaiting)

Source from the content-addressed store, hash-verified

1162 */
1163
1164 @GuardedBy("lock")
1165 private boolean awaitNanos(Guard guard, long nanos, boolean signalBeforeWaiting) throws InterruptedException {
1166 boolean firstTime = true;
1167 try {
1168 do {
1169 if (nanos <= 0L) {
1170 return false;
1171 }
1172 if (firstTime) {
1173 if (signalBeforeWaiting) {
1174 signalNextWaiter();
1175 }
1176 beginWaitingFor(guard);
1177 firstTime = false;
1178 }
1179 nanos = guard.condition.awaitNanos(nanos);
1180 } while (!guard.isSatisfied());
1181 return true;
1182 } finally {
1183 if (!firstTime) {
1184 endWaitingFor(guard);
1185 }
1186 }
1187 }
1188}

Callers 4

enterWhenMethod · 0.95
waitForMethod · 0.95

Calls 4

signalNextWaiterMethod · 0.95
beginWaitingForMethod · 0.95
endWaitingForMethod · 0.95
isSatisfiedMethod · 0.45

Tested by

no test coverage detected