aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-filelock/src
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-modules/archiva-base/archiva-filelock/src')
-rw-r--r--archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java b/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java
index 7d1011998..e97d3e141 100644
--- a/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java
+++ b/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/DefaultFileLockManager.java
@@ -65,7 +65,7 @@ public class DefaultFileLockManager
try
{
- Lock lock = new Lock( file, false );
+ Lock lock = null;
stopWatch.start();
@@ -84,6 +84,8 @@ public class DefaultFileLockManager
}
}
+ lock = new Lock( file, false );
+
Lock current = lockFiles.get( file );
if ( current != null )
@@ -143,12 +145,13 @@ public class DefaultFileLockManager
try
{
- Lock lock = new Lock( file, true );
+ Lock lock = null;
stopWatch.start();
while ( !acquired )
{
+
if ( timeout > 0 )
{
long delta = stopWatch.getTime();
@@ -161,6 +164,8 @@ public class DefaultFileLockManager
}
}
+ lock = new Lock( file, true );
+
Lock current = lockFiles.get( file );
if ( current != null )