-
public interface ThreadContextAn optional context available from theRootlookup, providing the ability to query whether code is running on the Root thread, and to pass tasks to invoke on the Root thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinvokeLater(Runnable task)Execute a task on the Root thread.booleanisInUpdate()Check whether the current thread is the active thread executing inside a Root update.booleanisRootThread()Check whether the current thread is the thread currently driving a Root implementation.
-
-
-
Method Detail
-
isInUpdate
boolean isInUpdate()
Check whether the current thread is the active thread executing inside a Root update.- Returns:
- current thread is in Root update
-
isRootThread
boolean isRootThread()
Check whether the current thread is the thread currently driving a Root implementation. This is a looser check thanisInUpdate()where a Root implementation may be driven by an external context - eg. UI event thread. It will always return true when isInUpdate() returns true. This method does not return true if a thread has been returned to a pool. As a guide, it will return true if blocking the current thread would block the Root from executing.- Returns:
- current thread is Root executing thread
-
invokeLater
void invokeLater(Runnable task)
Execute a task on the Root thread. The task should carefully check that its state is still valid - eg. a component should check that it has not been removed from the Root hierarchy.- Parameters:
task- task to be executed
-
-