From: Joel Rosdahl Date: Sat, 5 Aug 2023 08:59:00 +0000 (+0200) Subject: refactor: fs::path-ify LongLivedLockFileManager X-Git-Tag: v4.9~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a994fc3eeac5de975647ff4c46870c76d7e4dc6;p=thirdparty%2Fccache.git refactor: fs::path-ify LongLivedLockFileManager --- diff --git a/src/util/LongLivedLockFileManager.cpp b/src/util/LongLivedLockFileManager.cpp index 2e459eaf6..f3a9c07a3 100644 --- a/src/util/LongLivedLockFileManager.cpp +++ b/src/util/LongLivedLockFileManager.cpp @@ -21,9 +21,12 @@ #include #include #include +#include #include +namespace fs = util::filesystem; + #ifndef _WIN32 std::chrono::milliseconds k_keep_alive_interval{500}; #endif @@ -48,7 +51,7 @@ LongLivedLockFileManager::~LongLivedLockFileManager() void LongLivedLockFileManager::register_alive_file( - [[maybe_unused]] const std::string& path) + [[maybe_unused]] const fs::path& path) { #ifndef _WIN32 std::unique_lock lock(m_mutex); @@ -61,7 +64,7 @@ LongLivedLockFileManager::register_alive_file( void LongLivedLockFileManager::deregister_alive_file( - [[maybe_unused]] const std::string& path) + [[maybe_unused]] const fs::path& path) { #ifndef _WIN32 std::unique_lock lock(m_mutex); diff --git a/src/util/LongLivedLockFileManager.hpp b/src/util/LongLivedLockFileManager.hpp index 212097358..3a1485ebc 100644 --- a/src/util/LongLivedLockFileManager.hpp +++ b/src/util/LongLivedLockFileManager.hpp @@ -21,9 +21,9 @@ #include #include +#include #include #include -#include #include namespace util { @@ -34,8 +34,8 @@ public: LongLivedLockFileManager() = default; ~LongLivedLockFileManager(); - void register_alive_file(const std::string& path); - void deregister_alive_file(const std::string& path); + void register_alive_file(const std::filesystem::path& path); + void deregister_alive_file(const std::filesystem::path& path); private: #ifndef _WIN32 @@ -43,7 +43,7 @@ private: std::mutex m_mutex; std::condition_variable m_stop_condition; bool m_stop = false; - std::set m_alive_files; + std::set m_alive_files; void start_thread(); #endif