Project: SWT
Bug 90770 Race conditions in Device.getDevice() method
Reported: 2005-04-08 03:55:24 | Status: resolved fixed

Method org.eclipse.swt.graphics.Device.getDevice() is static and uses static variables (CurrentDevice). In application with several GUI threads it is possible (and it happens) that two or more GUI threads access Device.getDevice() method simultaneously. This leads to situation when getDevice(), called from one thread returns null because getDevice() in another thread set CurrentDevice variable to null.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Device.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Device.java bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Device.java