class LockFileManager
Declaration
class LockFileManager { /* full declaration omitted */ };
Description
Class that manages the creation of a lock file to aid implicit coordination between different processes. The implicit coordination works by creating a ".lock" file alongside the file that we're coordinating for, using the atomicity of the file system to ensure that only a single process can create that ".lock" file. When the lock file is removed, the owning process has finished the operation.
Declared at: llvm/include/llvm/Support/LockFileManager.h:27
Method Overview
- public LockFileManager(llvm::StringRef FileName)
- public std::string getErrorMessage() const
- public llvm::LockFileManager::LockFileState getState() const
- public llvm::LockFileManager::LockFileState operator llvm::LockFileManager::LockFileState() const
- public void setError(const std::error_code & EC, llvm::StringRef ErrorMsg = "")
- public std::error_code unsafeRemoveLockFile()
- public llvm::LockFileManager::WaitForUnlockResult waitForUnlock(const unsigned int MaxSeconds = 40)
- public ~LockFileManager()
Methods
¶LockFileManager(llvm::StringRef FileName)
LockFileManager(llvm::StringRef FileName)
Declared at: llvm/include/llvm/Support/LockFileManager.h:71
Parameters
- llvm::StringRef FileName
¶std::string getErrorMessage() const
std::string getErrorMessage() const
Description
Get error message, or "" if there is no error.
Declared at: llvm/include/llvm/Support/LockFileManager.h:89
¶llvm::LockFileManager::LockFileState getState()
const
llvm::LockFileManager::LockFileState getState()
const
Description
Determine the state of the lock file.
Declared at: llvm/include/llvm/Support/LockFileManager.h:75
¶llvm::LockFileManager::LockFileState
operator llvm::LockFileManager::LockFileState()
const
llvm::LockFileManager::LockFileState
operator llvm::LockFileManager::LockFileState()
const
Declared at: llvm/include/llvm/Support/LockFileManager.h:77
¶void setError(const std::error_code& EC,
llvm::StringRef ErrorMsg = "")
void setError(const std::error_code& EC,
llvm::StringRef ErrorMsg = "")
Description
Set error and error message
Declared at: llvm/include/llvm/Support/LockFileManager.h:92
Parameters
- const std::error_code& EC
- llvm::StringRef ErrorMsg = ""
¶std::error_code unsafeRemoveLockFile()
std::error_code unsafeRemoveLockFile()
Description
Remove the lock file. This may delete a different lock file than the one previously read if there is a race.
Declared at: llvm/include/llvm/Support/LockFileManager.h:86
¶llvm::LockFileManager::WaitForUnlockResult
waitForUnlock(const unsigned int MaxSeconds = 40)
llvm::LockFileManager::WaitForUnlockResult
waitForUnlock(const unsigned int MaxSeconds = 40)
Description
For a shared lock, wait until the owner releases the lock. Total timeout for the file to appear is ~1.5 minutes.
Declared at: llvm/include/llvm/Support/LockFileManager.h:82
Parameters
- const unsigned int MaxSeconds = 40
- the maximum wait time per iteration in seconds.
¶~LockFileManager()
~LockFileManager()
Declared at: llvm/include/llvm/Support/LockFileManager.h:72