@Override public final boolean isAlive() { return state != State.NEW && !future().isDone(); }
@Override public final boolean isCancelled() { return future().isCancelled(); }
@Override @Suspendable public final V get() throws ExecutionException, InterruptedException { try { return future().get(); } catch (RuntimeExecutionException t) { throw new ExecutionException(t.getCause()); } }
@Override @Suspendable public final V get(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException { try { return future().get(timeout, unit); } catch (RuntimeExecutionException t) { throw new ExecutionException(t.getCause()); } }
@Override public final boolean cancel(boolean mayInterruptIfRunning) { if (casState(State.NEW, State.TERMINATED)) future().cancel(mayInterruptIfRunning); else interrupt(); return !isDone(); }
/** * * @return {@code this} */ @Override public final Fiber<V> start() { if (!casState(State.NEW, State.STARTED)) { if (state == State.TERMINATED && future().isCancelled()) return this; throw new IllegalThreadStateException("Fiber has already been started or has died"); } getMonitor().fiberStarted(this); task.submit(); return this; }
private StackTraceElement[] execStackTrace1() { if (future().isDone()) return null; if (state == State.RUNNING)
boolean exec() { if (result != RESET && future().isDone()) // RESET only in overhead benchamrk return true; if (state == State.RUNNING)