diff options
author | Jiri Vanek <[email protected]> | 2013-04-25 14:25:45 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-04-25 14:25:45 +0200 |
commit | a2026c0ff7851152b932595a8c0de42eff262fab (patch) | |
tree | e22a886a27bbb09c9431be9dea1eceed772a35ea /netx/net/sourceforge/jnlp | |
parent | 0cc135f35c17bb59428a28d3cfee2bc2f65c5528 (diff) |
Locking disabled on windows machines
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r-- | netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java | 7 |
1 files changed, 7 insertions, 0 deletions
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) { |