Module java.base
Package java.dyn

Class CoroutineBase

  • Direct Known Subclasses:
    Coroutine

    public abstract class CoroutineBase
    extends Object
    * Abstract of coroutines.
    • Method Detail

      • run

        protected abstract void run()
        entry of coroutine
      • isFinished

        public final boolean isFinished()
        Returns:
        true if this coroutine has reached its end. Under normal circumstances this happens when the run() method returns.
      • getThread

        public Thread getThread()
        Returns:
        the thread that this coroutine is associated with
        Throws:
        NullPointerException - if the coroutine has been terminated
      • current

        public static CoroutineBase current()
        Returns:
        the current coroutine in the thread