From a2026c0ff7851152b932595a8c0de42eff262fab Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 25 Apr 2013 14:25:45 +0200 Subject: Locking disabled on windows machines --- netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'netx/net/sourceforge') diff --git a/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java b/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java index 2941dd9..046c675 100644 --- a/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java +++ b/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java @@ -44,6 +44,7 @@ import java.nio.channels.FileLock; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.locks.ReentrantLock; +import net.sourceforge.jnlp.runtime.JNLPRuntime; /* * Process & thread locked access to a file. Creates file if it does not already exist. @@ -112,6 +113,9 @@ public class LockedFile { * Lock access to the file. Lock is reentrant. */ public void lock() throws IOException { + if (JNLPRuntime.isWindows()) { + return; + } // Create if does not already exist, cannot lock non-existing file if (!isReadOnly()) { this.file.createNewFile(); @@ -136,6 +140,9 @@ public class LockedFile { * Unlock access to the file. Lock is reentrant. */ public void unlock() throws IOException { + if (JNLPRuntime.isWindows()) { + return; + } boolean releaseProcessLock = (this.threadLock.getHoldCount() == 1); try { if (releaseProcessLock) { -- cgit v1.2.3