Project: SWT
Bug 343560 Display.ayncExec(null) does not cause readAndDispatch() to return true.
Reported: 2011-04-21 10:48:58 | Status: resolved fixed

Run this snippet and stop moving the mouse or typing. On all platforms but cocoa, you get a sequence like this printed to the console. loop=true loop=false loop=true loop=false import org.eclipse.swt.widgets.*; public class SyncThread { public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); new Thread() { public void run() { while (!display.isDisposed()) { //1 // display.asyncExec(new Runnable() { // public void run() { // } // }); //2 display.asyncExec(null); //3 // display.wake(); try { Thread.sleep(500); } catch (Throwable e) {} } } }.start(); shell.pack(); shell.open(); while (!shell.isDisposed()) { boolean events = display.readAndDispatch(); System.out.println("loop=" + events); if (!events) display.sleep(); } display.dispose(); } }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/widgets/Synchronizer.java