aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
index ccca0279aa..420e737543 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
@@ -61,6 +61,7 @@ import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.FileTime;
import java.text.MessageFormat;
import java.time.Instant;
+import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
@@ -425,8 +426,10 @@ public class LockFile {
public void waitForStatChange() throws InterruptedException {
FileSnapshot o = FileSnapshot.save(ref);
FileSnapshot n = FileSnapshot.save(lck);
+ long fsTimeResolution = FS.getFileStoreAttributes(lck.toPath())
+ .getFsTimestampResolution().toNanos();
while (o.equals(n)) {
- Thread.sleep(25 /* milliseconds */);
+ TimeUnit.NANOSECONDS.sleep(fsTimeResolution);
try {
Files.setLastModifiedTime(lck.toPath(),
FileTime.from(Instant.now()));