From 0bce5fc411ca83d5c0b48e0e5f61611219bc353b Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 15 Mar 2007 14:45:29 +0000 Subject: [PATCH] closing channel always releases lock (on windows anyhow) git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@360 be28352e-c001-0410-b1a7-c7978e42abec --- src/uk/ac/vamsas/client/simpleclient/NativeLock.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uk/ac/vamsas/client/simpleclient/NativeLock.java b/src/uk/ac/vamsas/client/simpleclient/NativeLock.java index 69b7155..f980f45 100644 --- a/src/uk/ac/vamsas/client/simpleclient/NativeLock.java +++ b/src/uk/ac/vamsas/client/simpleclient/NativeLock.java @@ -78,10 +78,11 @@ public class NativeLock extends Lock { if (closeChannel && rafile.getChannel().isOpen()) { rafile.close(); rafile=null; + } else { + // just release the lock without doing anything to the channe;l + if (lock!=null && lock.isValid()) + lock.release(); } - if (lock!=null && lock.isValid()) - lock.release(); - } } catch (IOException e) { log.warn("Whilst releasing lock",e); -- 1.7.10.2