public interface MainThread
Provide access to the main or first Thread where certain APIs need the
ability to run tasks on the thread that initially started the VM. Instances
of MainThread should be obtained from the Hub Lookup.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanQuery whether the currently executing thread is the main thread.voidRun the provided task on the main thread.
-
Method Details
-
runLater
Run the provided task on the main thread. Tasks should not block and should run for as little time as possible. The task will run asynchronously.- Parameters:
task- Runnable task to execute.
-
isMainThread
boolean isMainThread()Query whether the currently executing thread is the main thread.- Returns:
- true if the current thread is the main thread, false otherwise.
-