Package org.graalvm.nativeimage
Class Threading
java.lang.Object
org.graalvm.nativeimage.Threading
Functionality related to execution in threads.
- Since:
- 19.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface that a callback handler needs to implement.static interface
Provides methods that are available during the execution of aThreading.RecurringCallback
. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
registerRecurringCallback
(long interval, TimeUnit unit, Threading.RecurringCallback callback) Registers acallback handler
that is called by the current thread approximately at the provided interval.
-
Method Details
-
registerRecurringCallback
public static void registerRecurringCallback(long interval, TimeUnit unit, Threading.RecurringCallback callback) Registers acallback 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 toThreading.RecurringCallbackAccess.throwException(Throwable)
.Specifying
null
forcallback
clears the current thread's callback (in which case, the values ofinterval
andunit
are ignored).- Since:
- 19.0
-