llvm.org GIT mirror llvm / ea280d9
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228603 91177308-0d34-0410-b5e6-96231b3b80d8 Ben Langmuir 5 years ago
2 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
7676
7777 /// \brief For a shared lock, wait until the owner releases the lock.
7878 WaitForUnlockResult waitForUnlock();
79
80 /// \brief Remove the lock file. This may delete a different lock file than
81 /// the one previously read if there is a race.
82 std::error_code unsafeRemoveLockFile();
7983 };
8084
8185 } // end namespace llvm
185185 Interval.tv_sec = 0;
186186 Interval.tv_nsec = 1000000;
187187 #endif
188 // Don't wait more than five minutes for the file to appear.
189 unsigned MaxSeconds = 300;
188 // Don't wait more than one minute for the file to appear.
189 unsigned MaxSeconds = 60;
190190 bool LockFileGone = false;
191191 do {
192192 // Sleep for the designated interval, to allow the owning process time to
262262 // Give up.
263263 return Res_Timeout;
264264 }
265
266 std::error_code LockFileManager::unsafeRemoveLockFile() {
267 return sys::fs::remove(LockFileName.str());
268 }