File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ class LockFileManager {
77
77
operator LockFileState () const { return getState (); }
78
78
79
79
// / For a shared lock, wait until the owner releases the lock.
80
- WaitForUnlockResult waitForUnlock ();
80
+ // / Total timeout for the file to appear is ~1.5 minutes.
81
+ // / \param MaxSeconds the maximum wait time per iteration in seconds.
82
+ WaitForUnlockResult waitForUnlock (const unsigned MaxSeconds = 40 );
81
83
82
84
// / Remove the lock file. This may delete a different lock file than
83
85
// / the one previously read if there is a race.
Original file line number Diff line number Diff line change @@ -290,7 +290,8 @@ LockFileManager::~LockFileManager() {
290
290
sys::DontRemoveFileOnSignal (UniqueLockFileName);
291
291
}
292
292
293
- LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock () {
293
+ LockFileManager::WaitForUnlockResult
294
+ LockFileManager::waitForUnlock (const unsigned MaxSeconds) {
294
295
if (getState () != LFS_Shared)
295
296
return Res_Success;
296
297
@@ -301,9 +302,6 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() {
301
302
Interval.tv_sec = 0 ;
302
303
Interval.tv_nsec = 1000000 ;
303
304
#endif
304
- // Don't wait more than 40s per iteration. Total timeout for the file
305
- // to appear is ~1.5 minutes.
306
- const unsigned MaxSeconds = 40 ;
307
305
do {
308
306
// Sleep for the designated interval, to allow the owning process time to
309
307
// finish up and remove the lock file.
You can’t perform that action at this time.
0 commit comments