summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-05-13 06:24:48 (EDT)
committerCaspar De Groot2011-05-13 06:24:48 (EDT)
commita9463e9c492ef80dcfa09a5074860e10d80b72d6 (patch)
treeb22238f49ec245e4adbee1071e69c6b23c71ce3a
parent477ff229e4d1e788ff08b1787e924d1f5308a9f3 (diff)
downloadcdo-a9463e9c492ef80dcfa09a5074860e10d80b72d6.zip
cdo-a9463e9c492ef80dcfa09a5074860e10d80b72d6.tar.gz
cdo-a9463e9c492ef80dcfa09a5074860e10d80b72d6.tar.bz2
[Bug 341995] ConcurrentModificationException on commit while holding a write
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341995
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java38
1 files changed, 10 insertions, 28 deletions
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 16bc464..c00d15b 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
@@ -113,9 +113,6 @@ public class CDOViewImpl extends AbstractCDOView
private long lastUpdateTime;
- @ExcludeFromDump
- private LastUpdateTimeLock lastUpdateTimeLock = new LastUpdateTimeLock();
-
private QueueRunner invalidationRunner;
@ExcludeFromDump
@@ -293,7 +290,7 @@ public class CDOViewImpl extends AbstractCDOView
}
long requiredTimestamp = result.getRequiredTimestamp();
- getSession().waitForUpdate(requiredTimestamp);
+ waitForUpdate(requiredTimestamp);
}
}
@@ -747,25 +744,19 @@ public class CDOViewImpl extends AbstractCDOView
super.doDeactivate();
}
- public long getLastUpdateTime()
+ public synchronized long getLastUpdateTime()
{
- synchronized (lastUpdateTimeLock)
- {
- return lastUpdateTime;
- }
+ return lastUpdateTime;
}
- public void setLastUpdateTime(long lastUpdateTime)
+ public synchronized void setLastUpdateTime(long lastUpdateTime)
{
- synchronized (lastUpdateTimeLock)
+ if (this.lastUpdateTime < lastUpdateTime)
{
- if (this.lastUpdateTime < lastUpdateTime)
- {
- this.lastUpdateTime = lastUpdateTime;
- }
-
- lastUpdateTimeLock.notifyAll();
+ this.lastUpdateTime = lastUpdateTime;
}
+
+ notifyAll();
}
public boolean waitForUpdate(long updateTime, long timeoutMillis)
@@ -773,7 +764,7 @@ public class CDOViewImpl extends AbstractCDOView
long end = timeoutMillis == NO_TIMEOUT ? Long.MAX_VALUE : System.currentTimeMillis() + timeoutMillis;
for (;;)
{
- synchronized (lastUpdateTimeLock)
+ synchronized (this)
{
if (lastUpdateTime >= updateTime)
{
@@ -788,7 +779,7 @@ public class CDOViewImpl extends AbstractCDOView
try
{
- lastUpdateTimeLock.wait(end - now);
+ wait(end - now);
}
catch (InterruptedException ex)
{
@@ -1134,15 +1125,6 @@ public class CDOViewImpl extends AbstractCDOView
*
* @author Eike Stepper
*/
- private static final class LastUpdateTimeLock
- {
- }
-
- /**
- * A separate class for better monitor debugging.
- *
- * @author Eike Stepper
- */
private static final class InvalidationRunnerLock
{
}