Package jline.util

Class LineTimeout

java.lang.Object
jline.util.LineTimeout

public final class LineTimeout extends Object
Session-level cooperative wall-clock budget (port of MATLAB lineTimeoutExceeded's global-deadline form). A per-solver runAnalyzer with a finite options.timeout arms the deadline and clears it in a finally block; deep utility loops with no options argument (e.g. multichoose during CTMC state-space generation) poll checkpoint(String) at safe points and abort with a RuntimeException, since a partially enumerated state space would silently yield wrong results.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkpoint(String context)
    Amortized checkpoint for hot loops: polls the clock once every 256 calls and throws when the armed deadline has passed.
    static void
    Disarm the deadline.
    static boolean
    True if a deadline is armed and has passed.
    static void
    set(double budgetSeconds)
    Arm the deadline; a non-finite or non-positive budget disarms it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • set

      public static void set(double budgetSeconds)
      Arm the deadline; a non-finite or non-positive budget disarms it.
    • clear

      public static void clear()
      Disarm the deadline.
    • exceeded

      public static boolean exceeded()
      True if a deadline is armed and has passed.
    • checkpoint

      public static void checkpoint(String context)
      Amortized checkpoint for hot loops: polls the clock once every 256 calls and throws when the armed deadline has passed. The stride is low because callers do heavy matrix work between calls (multichoose concatenations), so a large stride overshoots the budget by minutes.