From 8745f7acf1c5326699e1577fa9bb78fe4253da59 Mon Sep 17 00:00:00 2001 From: Max Schenkelberg Date: Mon, 7 Jan 2013 16:04:14 -0600 Subject: [PATCH] Issue #1329 fixed bug in FileLocker Change-Id: Ide1f4cb2d9f5d6f6ebfb2eed8bac583f0b0e153e Former-commit-id: d779a82c5eb74e7fc8eb45ba2671dd59929d2047 [formerly d779a82c5eb74e7fc8eb45ba2671dd59929d2047 [formerly 695f92db8aa698393bebfb4c2fed0bcf4d9d4efa]] Former-commit-id: 91a8e56302f925c368a4d35aabd8952b8102b23d Former-commit-id: 66f472ed37334c739d71ff16fb7f3d01bd0320f8 --- .../raytheon/uf/common/localization/FileLocker.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java b/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java index 09980ff99c..e71e9d5574 100644 --- a/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java +++ b/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java @@ -340,10 +340,12 @@ public class FileLocker { gotLock = lockFile.createNewFile() || ((fileTime = lockFile.lastModified()) > 0 && (System .currentTimeMillis() - fileTime) > MAX_WAIT); - try { - Thread.sleep(waitInterval); - } catch (InterruptedException e) { - // Ignore + if (!gotLock) { + try { + Thread.sleep(waitInterval); + } catch (InterruptedException e) { + // Ignore + } } } } catch (IOException e) {