8#ifndef LLVM_SUPPORT_LOCKFILEMANAGER_H
9#define LLVM_SUPPORT_LOCKFILEMANAGER_H
13#include <system_error>
57 std::optional<std::pair<std::string, int>> Owner;
58 std::error_code ErrorCode;
59 std::string ErrorDiagMsg;
64 static std::optional<std::pair<std::string, int>>
67 static bool processStillExecuting(
StringRef Hostname,
int PID);
94 ErrorDiagMsg = ErrorMsg.str();
This file defines the SmallString class.
Class that manages the creation of a lock file to aid implicit coordination between different process...
LockFileState
Describes the state of a lock file.
@ LFS_Error
An error occurred while trying to create or find the lock file.
@ LFS_Owned
The lock file has been created and is owned by this instance of the object.
@ LFS_Shared
The lock file already exists and is owned by some other instance.
std::string getErrorMessage() const
Get error message, or "" if there is no error.
void setError(const std::error_code &EC, StringRef ErrorMsg="")
Set error and error message.
std::error_code unsafeRemoveLockFile()
Remove the lock file.
WaitForUnlockResult waitForUnlock(const unsigned MaxSeconds=90)
For a shared lock, wait until the owner releases the lock.
WaitForUnlockResult
Describes the result of waiting for the owner to release the lock.
@ Res_Success
The lock was released successfully.
@ Res_Timeout
Reached timeout while waiting for the owner to release the lock.
@ Res_OwnerDied
Owner died while holding the lock.
LockFileState getState() const
Determine the state of the lock file.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.