diff --git a/src/cpp/rtps/RTPSDomain.cpp b/src/cpp/rtps/RTPSDomain.cpp index d89595b498f..22ea30afe87 100644 --- a/src/cpp/rtps/RTPSDomain.cpp +++ b/src/cpp/rtps/RTPSDomain.cpp @@ -144,7 +144,7 @@ RTPSParticipant* RTPSDomainImpl::createParticipant( if (!filename.empty() && SystemInfo::file_exists(filename)) { // Create filewatch - instance->file_watch_handle_ = SystemInfo::watch_file(filename, RTPSDomainImpl::file_watch_callback); + instance->file_watch_handle_ = SystemInfo::watch_file(filename, RTPSDomainImpl::file_watch_callback, {}, {}); } else if (!filename.empty()) { diff --git a/src/cpp/utils/SystemInfo.cpp b/src/cpp/utils/SystemInfo.cpp index 42f365720df..8c285d39b0e 100644 --- a/src/cpp/utils/SystemInfo.cpp +++ b/src/cpp/utils/SystemInfo.cpp @@ -214,7 +214,9 @@ const std::string& SystemInfo::get_environment_file() FileWatchHandle SystemInfo::watch_file( std::string filename, - std::function callback) + std::function callback, + const fastdds::rtps::ThreadSettings& watch_thread_config, + const fastdds::rtps::ThreadSettings& callback_thread_config) { #if defined(_WIN32) || defined(__unix__) return FileWatchHandle (new filewatch::FileWatch(filename, @@ -229,10 +231,12 @@ FileWatchHandle SystemInfo::watch_file( // No-op break; } - }, {}, {})); + }, watch_thread_config, callback_thread_config)); #else // defined(_WIN32) || defined(__unix__) static_cast(filename); static_cast(callback); + static_cast(watch_thread_config); + static_cast(callback_thread_config); return FileWatchHandle(); #endif // defined(_WIN32) || defined(__unix__) } diff --git a/src/cpp/utils/SystemInfo.hpp b/src/cpp/utils/SystemInfo.hpp index d2b4420c4be..418da3d9963 100644 --- a/src/cpp/utils/SystemInfo.hpp +++ b/src/cpp/utils/SystemInfo.hpp @@ -25,6 +25,8 @@ #include #include +#include + #include #include @@ -193,12 +195,16 @@ class SystemInfo * * @param [in] filename Path/name of the file to watch. * @param [in] callback Callback to execute when the file changes. + * @param [in] watch_thread_config Thread settings for watch thread. + * @param [in] callback_thread_config Thread settings for callback thread. * * @return The handle that represents the watcher object. */ static FileWatchHandle watch_file( std::string filename, - std::function callback); + std::function callback, + const fastdds::rtps::ThreadSettings& watch_thread_config, + const fastdds::rtps::ThreadSettings& callback_thread_config); /** * Stop a file watcher. diff --git a/test/unittest/utils/SystemInfoTests.cpp b/test/unittest/utils/SystemInfoTests.cpp index 58af62ed4e4..075a4ae0c84 100644 --- a/test/unittest/utils/SystemInfoTests.cpp +++ b/test/unittest/utils/SystemInfoTests.cpp @@ -238,7 +238,7 @@ TEST_F(SystemInfoTests, FileWatchTest) eprosima::SystemInfo::wait_for_file_closure(filename, _1s); ++times_called_; cv_.notify_all(); - }); + }, {}, {}); // Read contents {