Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-09-23 12:02:21 -0400
committerEike Stepper2013-09-23 12:02:21 -0400
commit6c239fef9c274d41fc88338c682aa01fa47dba7d (patch)
tree5754b260516861d16ef986defacb6d4bffea079e
parent53683da234edff709a27bbfc6beaa1a9c9065278 (diff)
downloadcdo-6c239fef9c274d41fc88338c682aa01fa47dba7d.tar.gz
cdo-6c239fef9c274d41fc88338c682aa01fa47dba7d.tar.xz
cdo-6c239fef9c274d41fc88338c682aa01fa47dba7d.zip
[417844] InvalidationRunner can die if invalidations come too early
https://bugs.eclipse.org/bugs/show_bug.cgi?id=417844
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueWorker.java26
1 files changed, 10 insertions, 16 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueWorker.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueWorker.java
index 66b7ef1ef2..d7beedfe4b 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueWorker.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueWorker.java
@@ -51,15 +51,12 @@ public abstract class QueueWorker<E> extends Worker
*/
public void clearQueue()
{
- if (queue != null)
- {
- queue.clear();
- }
+ queue.clear();
}
public boolean addWork(E element)
{
- if (queue != null && getLifecycleState() != LifecycleState.DEACTIVATING)
+ if (getLifecycleState() != LifecycleState.DEACTIVATING)
{
return queue.offer(element);
}
@@ -120,20 +117,17 @@ public abstract class QueueWorker<E> extends Worker
protected void doDeactivate() throws Exception
{
super.doDeactivate();
- if (queue != null)
+ if (doRemainingWorkBeforeDeactivate())
{
- if (doRemainingWorkBeforeDeactivate())
- {
- WorkContext context = new WorkContext();
- while (!queue.isEmpty())
- {
- doWork(context);
- }
- }
- else
+ WorkContext context = new WorkContext();
+ while (!queue.isEmpty())
{
- queue.clear();
+ doWork(context);
}
}
+ else
+ {
+ queue.clear();
+ }
}
}

Back to the top