Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-08-03 09:50:40 +0000
committerFlorian Noyrit2020-08-03 14:47:49 +0000
commit02c49f5c9589bc35c8ff25bd1f1192185148128a (patch)
treecacafd45e81c0c21701427bf7d12c9e3a4dfe84c /plugins
parentd6bcab8f9d947a735ec1f0544c55849aca52ed7c (diff)
downloadorg.eclipse.papyrus-02c49f5c9589bc35c8ff25bd1f1192185148128a.tar.gz
org.eclipse.papyrus-02c49f5c9589bc35c8ff25bd1f1192185148128a.tar.xz
org.eclipse.papyrus-02c49f5c9589bc35c8ff25bd1f1192185148128a.zip
Bug 565784 - In UISafeAdapter Display.syncExec() is unnecessary and causes deadlock when used with CDO
I change syncExec() to asyncExec(). Change-Id: Ia50d3b29d6e89e3d9eee566fe32fdadf83cf0812 Signed-off-by: Eike Stepper <stepper@esc-net.de>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome/src/org/eclipse/papyrus/infra/gmfdiag/welcome/internal/util/UISafeAdapter.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome/src/org/eclipse/papyrus/infra/gmfdiag/welcome/internal/util/UISafeAdapter.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome/src/org/eclipse/papyrus/infra/gmfdiag/welcome/internal/util/UISafeAdapter.java
index 0c43820e579..b34d70fd1e4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome/src/org/eclipse/papyrus/infra/gmfdiag/welcome/internal/util/UISafeAdapter.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome/src/org/eclipse/papyrus/infra/gmfdiag/welcome/internal/util/UISafeAdapter.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2016 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.welcome.internal.util;
@@ -38,7 +38,7 @@ public class UISafeAdapter extends AdapterImpl {
if (Display.getCurrent() != null) {
doNotifyChanged(msg);
} else {
- syncExec(Display.getDefault(),
+ execOnDisplay(Display.getDefault(),
msg.getNotifier(),
() -> doNotifyChanged(msg));
}
@@ -47,7 +47,7 @@ public class UISafeAdapter extends AdapterImpl {
/**
* Overridden by subclasses to react to a notification.
- *
+ *
* @param msg
* a notification
*/
@@ -55,7 +55,7 @@ public class UISafeAdapter extends AdapterImpl {
// Pass
}
- private void syncExec(Display display, Object notifier, Runnable action) {
+ private void execOnDisplay(Display display, Object notifier, Runnable action) {
// If we're in an editing domain and there is an active transaction,
// then we must be careful about how we synchronize with another thread,
// in case someone in the call chain attempts further model access
@@ -80,8 +80,8 @@ public class UISafeAdapter extends AdapterImpl {
// specification of the API) so just leave the action as is
}
}
-
+
// Go execute on the display thread
- display.syncExec(action);
+ display.asyncExec(action);
}
}

Back to the top