Class Synchronizer
java.lang.Object
org.eclipse.swt.widgets.Synchronizer
Instances of this class provide synchronization support
for displays. A default instance is created automatically
for each display, and this instance is sufficient for almost
all applications.
IMPORTANT: Typical application code never needs to deal with this class. It is provided only to allow applications which require non-standard synchronization behavior to plug in the support they require. Subclasses which override the methods in this class must ensure that the superclass methods are invoked in their implementations
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Display(package private) static final int(package private) static final boolean(package private) static final boolean(package private) static final int(package private) final ConcurrentLinkedQueue<RunnableLock> (package private) Thread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddLast(RunnableLock lock) protected voidCauses therun()method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.(package private) boolean(package private) voidmoveAllEventsTo(Synchronizer toReceiveTheEvents) Removes all pending events from the receiver and inserts them into the beginning of the given synchronizer's queue(package private) void(package private) RunnableLock(package private) boolean(package private) booleanrunAsyncMessages(boolean all) protected voidCauses therun()method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
-
Field Details
-
Constructor Details
-
Synchronizer
Constructs a new instance of this class.- Parameters:
display- the display to create the synchronizer on
-
-
Method Details
-
moveAllEventsTo
Removes all pending events from the receiver and inserts them into the beginning of the given synchronizer's queue- Parameters:
toReceiveTheEvents- the synchronizer that will receive the events
-
addLast
-
asyncExec
Causes therun()method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The caller of this method continues to run in parallel, and is not notified when the runnable has completed.- Parameters:
runnable- code to run on the user-interface thread.- See Also:
-
isMessagesEmpty
boolean isMessagesEmpty() -
releaseSynchronizer
void releaseSynchronizer() -
removeFirst
RunnableLock removeFirst() -
runAsyncMessages
boolean runAsyncMessages() -
runAsyncMessages
boolean runAsyncMessages(boolean all) -
syncExec
Causes therun()method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The thread which calls this method is suspended until the runnable completes.- Parameters:
runnable- code to run on the user-interface thread.- Throws:
SWTException-- ERROR_FAILED_EXEC - if an exception occurred when executing the runnable
- See Also:
-