Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2009-01-09 04:44:04 +0000
committerSimon Kaegi2009-01-09 04:44:04 +0000
commit7f2b725f9e0ecba1742127ab608302259df37c97 (patch)
tree5dc0591994dae6d5eb9f4404f2ed1b10732749d6
parentb9837c792d28c1a0b13130cc0357c39ad7364c34 (diff)
downloadrt.equinox.p2-7f2b725f9e0ecba1742127ab608302259df37c97.tar.gz
rt.equinox.p2-7f2b725f9e0ecba1742127ab608302259df37c97.tar.xz
rt.equinox.p2-7f2b725f9e0ecba1742127ab608302259df37c97.zip
Bug 257654 [engine] Cross process locking of profiles
Improving messages
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileLock.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileLock.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileLock.java
index 3d4046a09..c6d92df66 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileLock.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileLock.java
@@ -48,6 +48,9 @@ final class ProfileLock {
}
protected synchronized void checkLocked() {
+ if (lockHolder == null)
+ throw new IllegalStateException(Messages.SimpleProfileRegistry_Profile_not_locked);
+
Thread current = Thread.currentThread();
if (lockHolder != current)
throw new IllegalStateException(Messages.thread_not_owner);
@@ -75,9 +78,12 @@ final class ProfileLock {
}
protected void unlock() {
+ if (lockHolder == null)
+ throw new IllegalStateException(Messages.SimpleProfileRegistry_Profile_not_locked);
+
Thread current = Thread.currentThread();
if (lockHolder != current)
- throw new IllegalStateException(Messages.SimpleProfileRegistry_Profile_not_locked);
+ throw new IllegalStateException(Messages.thread_not_owner);
lockedCount--;
if (lockedCount == 0) {

Back to the top