From: jprocter Date: Thu, 15 Mar 2007 14:45:29 +0000 (+0000) Subject: closing channel always releases lock (on windows anyhow) X-Git-Tag: Release_0.2~160 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0bce5fc411ca83d5c0b48e0e5f61611219bc353b;p=vamsas.git 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 --- 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);