org.eclipse.swt.widgets
Class Synchronizer

java.lang.Object
  |
  +--org.eclipse.swt.widgets.Synchronizer

public class Synchronizer
extends Object

Unsafe: 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:
Display.setSynchronizer(org.eclipse.swt.widgets.Synchronizer)

Field Summary
(package private)  Display display
           
(package private)  int messageCount
           
(package private)  Object messageLock
           
(package private)  RunnableLock[] messages
           
(package private)  Thread syncThread
           
 
Constructor Summary
Synchronizer(Display display)
          Suppressed:
 
Method Summary
(package private)  void addLast(RunnableLock lock)
           
protected  void asyncExec(Runnable runnable)
          Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
(package private)  void releaseSynchronizer()
           
(package private)  RunnableLock removeFirst()
           
(package private)  boolean runAsyncMessages()
           
protected  void syncExec(Runnable runnable)
          Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display

Display display

messageCount

int messageCount

messages

RunnableLock[] messages

messageLock

Object messageLock

syncThread

Thread syncThread
Constructor Detail

Synchronizer

public Synchronizer(Display display)
Suppressed:

Method Detail

addLast

void addLast(RunnableLock lock)

asyncExec

protected void asyncExec(Runnable runnable)
Causes the 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.

Parameters:
runnable - code to run on the user-interface thread.
See Also:
syncExec(java.lang.Runnable)

releaseSynchronizer

void releaseSynchronizer()

removeFirst

RunnableLock removeFirst()

runAsyncMessages

boolean runAsyncMessages()

syncExec

protected void syncExec(Runnable runnable)
Causes the 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.

Parameters:
runnable - code to run on the user-interface thread.
See Also:
asyncExec(java.lang.Runnable)


comments?