Module java.base
Package java.lang

Class Continuation

java.lang.Object
java.lang.Continuation

public class Continuation
extends Object
TBD
  • Constructor Details

    • Continuation

      public Continuation​(ContinuationScope scope, Runnable target)
      TBD
      Parameters:
      scope - TBD
      target - TBD
    • Continuation

      public Continuation​(ContinuationScope scope, int stackSize, Runnable target)
      TBD
      Parameters:
      scope - TBD
      target - TBD
      stackSize - in bytes
  • Method Details

    • getCurrentContinuation

      public static Continuation getCurrentContinuation​(ContinuationScope scope)
      TBD
      Parameters:
      scope - TBD
      Returns:
      TBD
    • stackWalker

      public StackWalker stackWalker()
      TBD
      Returns:
      TBD
    • stackWalker

      public StackWalker stackWalker​(StackWalker.Option option)
      TBD
      Parameters:
      option - TBD
      Returns:
      TBD
    • stackWalker

      public StackWalker stackWalker​(Set<StackWalker.Option> options)
      TBD
      Parameters:
      options - TBD
      Returns:
      TBD
    • stackWalker

      public StackWalker stackWalker​(Set<StackWalker.Option> options, ContinuationScope scope)
      TBD
      Parameters:
      options - TBD
      scope - TBD
      Returns:
      TBD
    • getStackTrace

      public StackTraceElement[] getStackTrace()
      TBD
      Returns:
      TBD
      Throws:
      IllegalStateException - if the continuation is mounted
    • run

      public final void run()
      TBD
    • yield

      public static boolean yield​(ContinuationScope scope)
      TBD
      Parameters:
      scope - The ContinuationScope to yield
      Returns:
      true for success; false for failure
      Throws:
      IllegalStateException - if not currently in the given scope,
    • onPinned

      protected void onPinned​(Continuation.Pinned reason)
      TBD
      Parameters:
      reason - TBD
    • onContinue

      protected void onContinue()
      TBD
    • isDone

      public boolean isDone()
      TBD
      Returns:
      TBD
    • isPreempted

      public boolean isPreempted()
      TBD
      Returns:
      TBD
    • pin

      public static void pin()
      Pins the current continuation (enters a critical section). This increments an internal semaphore that, when greater than 0, pins the continuation.
    • unpin

      public static void unpin()
      Unpins the current continuation (exits a critical section). This decrements an internal semaphore that, when equal 0, unpins the current continuation if pinne with pin().
    • isPinned

      public static boolean isPinned​(ContinuationScope scope)
      Tests whether the given scope is pinned. This method is slow.
      Parameters:
      scope - the continuation scope
      Returns:
      true if we're in the give scope and are pinned; false otherwise
    • something_something_1

      public void something_something_1()
      temporary testing
    • something_something_2

      public void something_something_2()
      temporary testing
    • something_something_3

      public void something_something_3()
      temporary testing
    • getNumFrames

      public int getNumFrames()
      TBD
      Returns:
      TBD
    • getNumInterpretedFrames

      public int getNumInterpretedFrames()
      TBD
      Returns:
      TBD
    • getStackUsageInBytes

      public int getStackUsageInBytes()
      TBD
      Returns:
      TBD
    • getNumRefs

      public int getNumRefs()
      TBD
      Returns:
      TBD
    • tryPreempt

      public Continuation.PreemptStatus tryPreempt​(Thread thread)
      TBD Subclasses may throw an UnsupportedOperationException, but this does not prevent the continuation from being preempted on a parent scope.
      Parameters:
      thread - TBD
      Returns:
      TBD
      Throws:
      UnsupportedOperationException - if this continuation does not support preemption