17 #ifndef LIB_WINSS_PATH_MUTEX_HPP_ 18 #define LIB_WINSS_PATH_MUTEX_HPP_ 24 namespace fs = std::experimental::filesystem;
44 PathMutex(fs::path path, std::string name);
75 virtual const std::string&
GetName()
const;
84 #endif // LIB_WINSS_PATH_MUTEX_HPP_ PathMutex()
Hide the default constructor.
Definition: path_mutex.hpp:35
A global mutex where the key is derived from a file path and service name.
Definition: path_mutex.hpp:30
virtual bool CanLock() const
Checks if the lock will fail or not.
Definition: path_mutex.cpp:62
virtual bool HasLock() const
Checks if this instance owns the lock.
Definition: path_mutex.cpp:82
Definition: case_ignore.hpp:23
virtual bool Lock()
Attempts to get the mutex.
Definition: path_mutex.cpp:37
HANDLE lock
A handle to the Windows mutex.
Definition: path_mutex.hpp:33
virtual ~PathMutex()
Default destructor.
Definition: path_mutex.cpp:90
PathMutex & operator=(const PathMutex &)=delete
No copy.
virtual const std::string & GetName() const
Gets the name of the service.
Definition: path_mutex.cpp:86
std::string mutex_name
The service name.
Definition: path_mutex.hpp:32