-
- Enclosing class:
- PApplet
public static interface PApplet.MainThreadContextA context for running tasks on the main (first) thread of the application. On some OS it is important that various UI operations are handled on this thread. To access the main thread context usePApplet.mainThread().
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisMainThread()Query whether the current thread is the main thread.voidrunLater(Runnable task)Run the provided task asynchronously on the main thread.
-
-
-
Method Detail
-
runLater
void runLater(Runnable task)
Run the provided task asynchronously on the main thread.- Parameters:
task- runnable task
-
isMainThread
boolean isMainThread()
Query whether the current thread is the main thread.- Returns:
- true if current thread is main thread
-
-