Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-01-16 03:29:50 -0500
committerEike Stepper2016-01-16 03:29:50 -0500
commit5c0eface8b30653f24895d753ed1dee469f17d2b (patch)
treea3c99acba40d244f7ac0319795e35f790504698d
parent6e127a8133abef5a5f04cbe1a0a740cc647cbb0c (diff)
downloadcdo-5c0eface8b30653f24895d753ed1dee469f17d2b.tar.gz
cdo-5c0eface8b30653f24895d753ed1dee469f17d2b.tar.xz
cdo-5c0eface8b30653f24895d753ed1dee469f17d2b.zip
[323788] Deadlock on Display.syncExec()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323788
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java47
2 files changed, 47 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
index 1d2ebc7c1e..ea6c00c384 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
@@ -278,7 +278,6 @@ public abstract class SessionConfig extends Config implements ISessionConfig
{
final File lobCache = getCurrentTest().createTempFolder("lobs_" + new Date().getTime() + "_", ".tmp");
session.options().setLobCache(new CDOLobStoreImpl(lobCache));
- session.options().setDelegableViewLockEnabled(true);
session.addListener(new LifecycleEventAdapter()
{
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 721c2bbebc..71f3f4ed2b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -78,6 +78,8 @@ import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.event.Notifier;
import org.eclipse.net4j.util.event.ThrowableEvent;
+import org.eclipse.net4j.util.lifecycle.ILifecycle;
+import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
import org.eclipse.net4j.util.lifecycle.LifecycleException;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.log.OMLogger;
@@ -116,6 +118,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
@@ -1543,6 +1546,11 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
}
lockOwner = CDOLockUtil.createLockOwner(this);
+
+ if (viewLock != null && Boolean.getBoolean("org.eclipse.emf.cdo.sync.tester"))
+ {
+ new SyncTester().start();
+ }
}
@Override
@@ -2399,6 +2407,45 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
/**
* @author Eike Stepper
+ */
+ private final class SyncTester extends Thread
+ {
+ private final CountDownLatch latch = new CountDownLatch(1);
+
+ public SyncTester()
+ {
+ super(CDOViewImpl.this + "-sync-tester");
+ setDaemon(true);
+ }
+
+ @Override
+ public void run()
+ {
+ addListener(new LifecycleEventAdapter()
+ {
+ @Override
+ protected void onAboutToDeactivate(ILifecycle lifecycle)
+ {
+ latch.countDown();
+ }
+ });
+
+ synchronized (CDOViewImpl.this)
+ {
+ try
+ {
+ latch.await();
+ }
+ catch (InterruptedException ex)
+ {
+ return;
+ }
+ }
+ }
+ }
+
+ /**
+ * @author Eike Stepper
* @since 2.0
*/
public class OptionsImpl extends Notifier implements Options

Back to the top