Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java
index bba55ad7b..da72e01a9 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/loader/ClasspathManager.java
@@ -512,17 +512,23 @@ public class ClasspathManager {
Thread current = Thread.currentThread();
if (lockingThread == current)
return false;
- while (true) {
- if (lockingThread == null) {
- classNameLocks.put(classname, current);
- return true;
- }
- try {
+ boolean previousInterruption = Thread.interrupted();
+ try {
+ while (true) {
+ if (lockingThread == null) {
+ classNameLocks.put(classname, current);
+ return true;
+ }
+
classNameLocks.wait();
lockingThread = classNameLocks.get(classname);
- } catch (InterruptedException e) {
+ }
+ } catch (InterruptedException e) {
+ current.interrupt();
+ throw (LinkageError) new LinkageError(classname).initCause(e);
+ } finally {
+ if (previousInterruption) {
current.interrupt();
- throw (LinkageError) new LinkageError(classname).initCause(e);
}
}
}

Back to the top