public class Synchronizer
extends java.lang.Object
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
| Modifier and Type | Field and Description |
|---|---|
(package private) Display |
display |
(package private) static int |
GROW_SIZE |
(package private) static boolean |
IS_CARBON |
(package private) static boolean |
IS_COCOA |
(package private) static boolean |
IS_GTK |
(package private) static int |
MESSAGE_LIMIT |
(package private) int |
messageCount |
(package private) java.lang.Object |
messageLock |
(package private) RunnableLock[] |
messages |
(package private) java.lang.Thread |
syncThread |
| Constructor and Description |
|---|
Synchronizer(Display display)
Constructs a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addLast(RunnableLock lock) |
protected void |
asyncExec(java.lang.Runnable runnable)
Causes the
run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity. |
(package private) int |
getMessageCount() |
(package private) void |
releaseSynchronizer() |
(package private) RunnableLock |
removeFirst() |
(package private) boolean |
runAsyncMessages() |
(package private) boolean |
runAsyncMessages(boolean all) |
protected void |
syncExec(java.lang.Runnable runnable)
Causes the
run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity. |
Display display
int messageCount
RunnableLock[] messages
java.lang.Object messageLock
java.lang.Thread syncThread
static final int GROW_SIZE
static final int MESSAGE_LIMIT
static final boolean IS_CARBON
static final boolean IS_COCOA
static final boolean IS_GTK
public Synchronizer(Display display)
display - the display to create the synchronizer onvoid addLast(RunnableLock lock)
protected void asyncExec(java.lang.Runnable runnable)
run() 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.runnable - code to run on the user-interface thread.syncExec(java.lang.Runnable)int getMessageCount()
void releaseSynchronizer()
RunnableLock removeFirst()
boolean runAsyncMessages()
boolean runAsyncMessages(boolean all)
protected void syncExec(java.lang.Runnable runnable)
run() 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.runnable - code to run on the user-interface thread.SWTException - asyncExec(java.lang.Runnable)