diff options
author | Vedant Kumar <vsk@apple.com> | 2020-01-10 15:24:30 -0800 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2020-01-10 15:24:32 -0800 |
commit | e05e219926f90ccab927b7b1af6d14aa6dd52571 (patch) | |
tree | 0073e90cb5c741553df139e02127768ca8fb0ac9 /llvm/lib/Support/LockFileManager.cpp | |
parent | 7a38468e34eeeb59e80b176b97213d205d8d9b41 (diff) | |
download | bcm5719-llvm-e05e219926f90ccab927b7b1af6d14aa6dd52571.tar.gz bcm5719-llvm-e05e219926f90ccab927b7b1af6d14aa6dd52571.zip |
[LockFileManager] Make default waitForUnlock timeout a parameter, NFC
Patch by Xi Ge!
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r-- | llvm/lib/Support/LockFileManager.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp index 10181192afb..5c6508c3b00 100644 --- a/llvm/lib/Support/LockFileManager.cpp +++ b/llvm/lib/Support/LockFileManager.cpp @@ -290,7 +290,8 @@ LockFileManager::~LockFileManager() { sys::DontRemoveFileOnSignal(UniqueLockFileName); } -LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { +LockFileManager::WaitForUnlockResult +LockFileManager::waitForUnlock(const unsigned MaxSeconds) { if (getState() != LFS_Shared) return Res_Success; @@ -301,9 +302,6 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { Interval.tv_sec = 0; Interval.tv_nsec = 1000000; #endif - // Don't wait more than 40s per iteration. Total timeout for the file - // to appear is ~1.5 minutes. - const unsigned MaxSeconds = 40; do { // Sleep for the designated interval, to allow the owning process time to // finish up and remove the lock file. |