changed unlock() method to use remove() instead of clearProperty

as this doesn't work on some platforms

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@603927 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-12-13 14:45:01 +00:00
parent d4d9ba88b9
commit 0ac3f165dc
2 changed files with 7 additions and 3 deletions

View File

@ -503,9 +503,11 @@ public class KahaStore implements Store {
private synchronized void unlock() throws IOException {
if (!DISABLE_LOCKING && (null != directory) && (null != lock)) {
System.clearProperty(getPropertyKey());
//clear property doesn't work on some platforms
System.getProperties().remove(getPropertyKey());
if (lock.isValid()) {
lock.release();
lock.channel().close();
}
lock = null;
}

View File

@ -887,10 +887,12 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
}
private synchronized void unlock() throws IOException {
if (!disableLocking && (null != directory) && (null != lock)) {
System.clearProperty(getPropertyKey());
if (!disableLocking && (null != lock)) {
//clear property doesn't work on some platforms
System.getProperties().remove(getPropertyKey());
if (lock.isValid()) {
lock.release();
lock.channel().close();
}
lock = null;
}