summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2005-05-02 20:34:07 +0000
committerSilenio Quarti <silenio>2005-05-02 20:34:07 +0000
commite0a7cac092acc69b52668428509d14cbaf5ae176 (patch)
treed6888be3733d9f3fe96f031baa828d4347048791 /bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
parente842a3c701cf3040202dbe363ff026b791322937 (diff)
downloadeclipse.platform.swt-e0a7cac092acc69b52668428509d14cbaf5ae176.tar.gz
eclipse.platform.swt-e0a7cac092acc69b52668428509d14cbaf5ae176.tar.xz
eclipse.platform.swt-e0a7cac092acc69b52668428509d14cbaf5ae176.zip
93294
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java36
1 files changed, 20 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
index ae6e5b3d54..de3319a4a0 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
@@ -97,6 +97,8 @@ public abstract class Device implements Drawable {
static int XErrorProc, XIOErrorProc, XNullErrorProc, XNullIOErrorProc;
static Device[] Devices = new Device[4];
+ static final Object CREATE_LOCK = new Object();
+
/* Initialize X and Xt */
static {
/*
@@ -165,23 +167,25 @@ public Device() {
* @see DeviceData
*/
public Device(DeviceData data) {
- if (data != null) {
- display_name = data.display_name;
- application_name = data.application_name;
- application_class = data.application_class;
- tracking = data.tracking;
- debug = data.debug;
- }
- if (tracking) {
- errors = new Error [128];
- objects = new Object [128];
+ synchronized (CREATE_LOCK) {
+ if (data != null) {
+ display_name = data.display_name;
+ application_name = data.application_name;
+ application_class = data.application_class;
+ tracking = data.tracking;
+ debug = data.debug;
+ }
+ if (tracking) {
+ errors = new Error [128];
+ objects = new Object [128];
+ }
+ create (data);
+ init ();
+ register (this);
+
+ /* Initialize the system font slot */
+ systemFont = getSystemFont ();
}
- create (data);
- init ();
- register (this);
-
- /* Initialize the system font slot */
- systemFont = getSystemFont ();
}
void checkCairo() {