diff options
author | Ben Langmuir <blangmuir@apple.com> | 2015-02-09 20:34:24 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2015-02-09 20:34:24 +0000 |
commit | d2d52de229393d5333290748f7a85ed9e727ed38 (patch) | |
tree | a189a9a60d22b341db8b3c1321321038d245168d /llvm/lib/Support/LockFileManager.cpp | |
parent | 955c4ff9c3a5832ba9309b6945d053af18dc27a6 (diff) | |
download | bcm5719-llvm-d2d52de229393d5333290748f7a85ed9e727ed38.tar.gz bcm5719-llvm-d2d52de229393d5333290748f7a85ed9e727ed38.zip |
Reduce the LockFileManager timeout, and provide unsafeRemoveLockFile
5 minutes is an eternity, so try to strike a better balance between
waiting long enough for any reasonable module build and not so long that
users kill the process because they think it's hanging.
Also give the client a way to delete the lock file after a timeout.
llvm-svn: 228603
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r-- | llvm/lib/Support/LockFileManager.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp index 5b82c367c0a..9ec52ac5409 100644 --- a/llvm/lib/Support/LockFileManager.cpp +++ b/llvm/lib/Support/LockFileManager.cpp @@ -186,8 +186,8 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { Interval.tv_sec = 0; Interval.tv_nsec = 1000000; #endif - // Don't wait more than five minutes for the file to appear. - unsigned MaxSeconds = 300; + // Don't wait more than one minute for the file to appear. + unsigned MaxSeconds = 60; bool LockFileGone = false; do { // Sleep for the designated interval, to allow the owning process time to @@ -263,3 +263,7 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { // Give up. return Res_Timeout; } + +std::error_code LockFileManager::unsafeRemoveLockFile() { + return sys::fs::remove(LockFileName.str()); +} |