Top Description Inners Constructors Methods
org.graalvm.nativeimage

public final Class Threading

extends Object
Class Inheritance
Imports
java.util.concurrent.TimeUnit, org.graalvm.nativeimage.impl.ThreadingSupport

Functionality related to execution in threads.
Since
19.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Threading.RecurringCallback

Interface that a callback handler needs to implement.

public static interface
Threading.RecurringCallbackAccess

Provides methods that are available during the execution of a RecurringCallback.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Threadingback to summary
private Threading()

Method Detail

registerRecurringCallbackback to summary
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 RecurringCallbackAccess#throwException(Throwable).

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

Since
19.0
org.graalvm.nativeimage back to summary

public Interface Threading.RecurringCallback

Annotations
@FunctionalInterface

Interface that a callback handler needs to implement.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public void
run(Threading.RecurringCallbackAccess access)

Method that is called recurringly when the callback handler is installed.

Method Detail

runback to summary
public void run(Threading.RecurringCallbackAccess access)

Method that is called recurringly when the callback handler is installed.

Since
19.0
org.graalvm.nativeimage back to summary

public Interface Threading.RecurringCallbackAccess


Provides methods that are available during the execution of a RecurringCallback.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public void
throwException(Throwable t)

Throws an exception from the recurring callback to the code that is regularly executing in the thread.

Method Detail

throwExceptionback to summary
public void throwException(Throwable t)

Throws an exception from the recurring callback to the code that is regularly executing in the thread.

Since
19.0