Class Threading


public final class Threading extends Object
Functionality related to execution in threads.
  • Method Details

    • registerRecurringCallback

      public static void registerRecurringCallback(long interval, TimeUnit unit, Threading.RecurringCallback callback)
      Registers a callback handler that is called by the current thread approximately at the provided interval. Only one callback can be active per thread. Each thread can have its own callback with a different interval (or none at all). No guarantees are made about the actual interval. For example, when the thread is waiting for a lock or executing native code, no callback can be done. Exceptions that are thrown during the execution of the callback are caught and ignored, unless they are thrown via a call to Threading.RecurringCallbackAccess.throwException(Throwable).

      Specifying null for callback clears the current thread's callback (in which case, the values of interval and unit are ignored).