X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/a5cb4cf37e5dfa9bb9ce5c5e4ccf8d5978d3576f..a500fb72810060e52d87ad2c2e4691531f0bcc5a:/projects/stargazer/plugins/other/ping/ping.h diff --git a/projects/stargazer/plugins/other/ping/ping.h b/projects/stargazer/plugins/other/ping/ping.h index 9986be39..23874e37 100644 --- a/projects/stargazer/plugins/other/ping/ping.h +++ b/projects/stargazer/plugins/other/ping/ping.h @@ -10,10 +10,13 @@ #include #include +#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#pragma GCC diagnostic pop #include -#include - class PING; namespace STG @@ -118,7 +121,7 @@ private: void GetUsers(); void SetUserNotifiers(UserPtr u); void UnSetUserNotifiers(UserPtr u); - static void * Run(void * d); + void Run(std::stop_token token); mutable std::string errorStr; PING_SETTINGS pingSettings; @@ -126,9 +129,8 @@ private: STG::Users * users; std::list usersList; - pthread_t thread; - pthread_mutex_t mutex; - bool nonstop; + std::jthread m_thread; + std::mutex m_mutex; bool isRunning; mutable STG_PINGER pinger;