private static void park(long time) throws SuspendExecution { if (time != 0) Strand.parkNanos(time); else Strand.park(); } }
Strand.parkNanos(nanos); } catch (SuspendExecution e) { throw RuntimeSuspendExecution.of(e);
Strand.parkNanos(blocker, nanos); } catch (SuspendExecution e) { throw RuntimeSuspendExecution.of(e);
public boolean block() throws InterruptedException, SuspendExecution { if (isReleasable()) return true; else if (!timed) { // System.out.println("PHASER " + (System.currentTimeMillis() % 300000) + " " + phase + " " + Fiber.currentFiber() + " " + Thread.currentThread() + " - BLOCKED"); Strand.park(this); } else if (nanos > 0) Strand.parkNanos(this, nanos); return isReleasable(); } }
long now = System.nanoTime(); if ((nanos -= now - lastTime) > 0) Strand.parkNanos(this, nanos); lastTime = now; } else
if (shouldParkAfterFailedAcquire(p, node) && nanosTimeout > spinForTimeoutThreshold) Strand.parkNanos(this, nanosTimeout); if (Strand.interrupted()) throw new InterruptedException();
if (shouldParkAfterFailedAcquire(p, node) && nanosTimeout > spinForTimeoutThreshold) Strand.parkNanos(this, nanosTimeout); if (Strand.interrupted()) throw new InterruptedException();
if (shouldParkAfterFailedAcquire(p, node) && nanosTimeout > spinForTimeoutThreshold) Strand.parkNanos(this, nanosTimeout); if (Strand.interrupted()) throw new InterruptedException();
if (shouldParkAfterFailedAcquire(p, node) && nanosTimeout > spinForTimeoutThreshold) Strand.parkNanos(this, nanosTimeout); if (Strand.interrupted()) throw new InterruptedException();
Strand.parkNanos(this, nanosTimeout); if ((interruptMode = checkInterruptWhileWaiting(node)) != 0) break;
public void awaitNanos(int iter, long timeoutNanos) throws InterruptedException, SuspendExecution { final int spins; final Fiber<?> fib = Fiber.currentFiber(); if (fib != null) { spins = 0; if (iter > 0) fib.getMonitor().spuriousWakeup(); } else spins = SPINS - iter; if (spins > 0) { if (ThreadLocalRandom.current().nextInt(SPINS) == 0) Strand.yield(); } else { if (isRecording()) record("await", "%s parking", Strand.currentStrand()); Strand.parkNanos(owner, timeoutNanos); if (isRecording()) record("await", "%s awoke", Strand.currentStrand()); } if (Strand.interrupted()) throw new InterruptedException(); }
Strand.parkNanos(this, nanosTimeout); if ((interruptMode = checkInterruptWhileWaiting(node)) != 0) break;
Strand.parkNanos(this, nanosTimeout); if ((interruptMode = checkInterruptWhileWaiting(node)) != 0) break;
Strand.parkNanos(this, nanosTimeout); if ((interruptMode = checkInterruptWhileWaiting(node)) != 0) break;
long now = System.nanoTime(); if ((nanos -= now - lastTime) > 0) Strand.parkNanos(this, nanos); lastTime = now; } else {