summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-03-09 02:39:32 (EST)
committerCaspar De Groot2011-03-09 02:39:32 (EST)
commit83fa8fa1985aa69b77654ed6c5098e52f51fea4d (patch)
tree753fdee87b3d3644b50fd30f1818cfe64e8b9854
parent156bbdb292999faa6eb1a458485b58cf00e13167 (diff)
downloadcdo-83fa8fa1985aa69b77654ed6c5098e52f51fea4d.zip
cdo-83fa8fa1985aa69b77654ed6c5098e52f51fea4d.tar.gz
cdo-83fa8fa1985aa69b77654ed6c5098e52f51fea4d.tar.bz2
[Bug 339064] CDOSessionImpl.waitForUpdate is unreliable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=339064
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java28
1 files changed, 7 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 82ad06c..559fa47 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -860,31 +860,17 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
public boolean waitForUpdate(long updateTime, long timeoutMillis)
{
long end = timeoutMillis == NO_TIMEOUT ? Long.MAX_VALUE : System.currentTimeMillis() + timeoutMillis;
- for (;;)
+ for (CDOView view : views)
{
- synchronized (lastUpdateTimeLock)
+ long viewTimeoutMillis = timeoutMillis == NO_TIMEOUT ? NO_TIMEOUT : end - System.currentTimeMillis();
+ boolean ok = view.waitForUpdate(updateTime, viewTimeoutMillis);
+ if (!ok)
{
- if (lastUpdateTime >= updateTime)
- {
- return true;
- }
-
- long now = System.currentTimeMillis();
- if (now >= end)
- {
- return false;
- }
-
- try
- {
- lastUpdateTimeLock.wait(end - now);
- }
- catch (InterruptedException ex)
- {
- throw WrappedException.wrap(ex);
- }
+ return false;
}
}
+
+ return true;
}
/**