MCPcopy Create free account
hub / github.com/Kitware/CMake / LockWithTimeout

Method LockWithTimeout

Source/cmFileLockUnix.cxx:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49cmFileLockResult cmFileLock::LockWithTimeout(unsigned long seconds)
50{
51 while (true) {
52 if (this->LockFile(F_SETLK, F_WRLCK) == -1) {
53 if (errno != EACCES && errno != EAGAIN) {
54 return cmFileLockResult::MakeSystem();
55 }
56 } else {
57 return cmFileLockResult::MakeOk();
58 }
59 if (seconds == 0) {
60 return cmFileLockResult::MakeTimeout();
61 }
62 --seconds;
63 cmSystemTools::Delay(1000);
64 }
65}
66
67int cmFileLock::LockFile(int cmd, int type) const
68{

Callers 1

LockMethod · 0.95

Calls 1

LockFileMethod · 0.95

Tested by

no test coverage detected