@Override public void unpark(Object unblocker) { super.unpark( unblocker == FiberTask.EMERGENCY_UNBLOCKER ? ParkableForkJoinTask.EMERGENCY_UNBLOCKER : unblocker); }
@Override @DontInstrument public void yield() throws SuspendExecution { try { super.yield(); } catch (SuspendExecution p) { throw p; } catch (Exception e) { throw new AssertionError(e); } }
@Override public void setState(int state) { super.setState(state); }
@Override protected void onParked(boolean yield) { super.onParked(yield); fiber.onParked(); }
@Override public void doPark(boolean yield) { super.doPark(yield); }
@Override Object getCurrentTarget(Thread currentThread) { if (isFiberThread(currentThread)) return ParkableForkJoinTask.getTarget(currentThread); else return Fiber.getCurrentStrand(); }
@Override void setCurrentTarget(Object target, Thread currentThread) { if (isFiberThread(currentThread)) ParkableForkJoinTask.setTarget(currentThread, target); else Fiber.setCurrentStrand((Strand) target); }
@Override void setCurrentFiber(Fiber target, Thread currentThread) { if (isFiberThread(currentThread)) ParkableForkJoinTask.setTarget(currentThread, target.fiberRef); else Fiber.setCurrentStrand(target); }
static Fiber getTargetFiber(Thread thread) { final Object target = ParkableForkJoinTask.getTarget(thread); if (target == null || !(target instanceof Fiber.DummyRunnable)) return null; return ((Fiber.DummyRunnable) target).fiber; }