closing channel always releases lock (on windows anyhow)
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 15 Mar 2007 14:45:29 +0000 (14:45 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 15 Mar 2007 14:45:29 +0000 (14:45 +0000)
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

index 69b7155..f980f45 100644 (file)
@@ -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);