Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2017-01-16 04:15:06 -0500
committerEike Stepper2017-01-16 04:15:06 -0500
commit0dd51c199c7d3e8acc97ffb1e88cc9cd58b29b44 (patch)
treefd796c7015920dd375bfad59bed222c4a0fa9df4
parent3b8aef72846a7980c7350d29edae91965802212e (diff)
downloadcdo-0dd51c199c7d3e8acc97ffb1e88cc9cd58b29b44.tar.gz
cdo-0dd51c199c7d3e8acc97ffb1e88cc9cd58b29b44.tar.xz
cdo-0dd51c199c7d3e8acc97ffb1e88cc9cd58b29b44.zip
[510491] Owner thread can be null in DisplayDelegateDetector.isDelegate()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=510491
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/DisplayDelegateDetector.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonFairReentrantLock.java8
2 files changed, 8 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/DisplayDelegateDetector.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/DisplayDelegateDetector.java
index cb7166e3d5..7d93edffd1 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/DisplayDelegateDetector.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/DisplayDelegateDetector.java
@@ -29,7 +29,7 @@ public class DisplayDelegateDetector implements DelegateDetector
public boolean isDelegate(Thread thread, Thread owner)
{
- if (owner.getState() == State.WAITING)
+ if (owner != null && owner.getState() == State.WAITING)
{
Display display = UIUtil.getDisplay();
Thread displayThread = display.getThread();
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonFairReentrantLock.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonFairReentrantLock.java
index 5f408c1fa0..9fe00d2048 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonFairReentrantLock.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/NonFairReentrantLock.java
@@ -253,7 +253,13 @@ public class NonFairReentrantLock implements Lock, Serializable
private boolean isHeldExclusively(Thread current)
{
- return isOwner(current, getExclusiveOwnerThread());
+ Thread exclusiveOwnerThread = getExclusiveOwnerThread();
+ if (exclusiveOwnerThread == null)
+ {
+ return false;
+ }
+
+ return isOwner(current, exclusiveOwnerThread);
}
/**

Back to the top