X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/0907aa4037b12b6b88ee24495d4577a064d4f8db..38f134e6a96c08fdd7d4ed07ca3550e8434d56e9:/projects/stargazer/users_impl.h diff --git a/projects/stargazer/users_impl.h b/projects/stargazer/users_impl.h index ef5ee0ec..5aa2a494 100644 --- a/projects/stargazer/users_impl.h +++ b/projects/stargazer/users_impl.h @@ -26,6 +26,11 @@ #include #include #include +#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#pragma GCC diagnostic pop #include #include @@ -133,7 +138,7 @@ private: void AddUserIntoIndexes(user_iter user); void DelUserFromIndexes(user_iter user); - static void * Run(void *); + void Run(std::stop_token token); void NewMinute(const struct tm & t); void NewDay(const struct tm & t); void DayResetTraff(const struct tm & t); @@ -153,11 +158,10 @@ private: const Admin& sysAdmin; Logger & WriteServLog; - bool nonstop; bool isRunning; - mutable pthread_mutex_t mutex; - pthread_t thread; + mutable std::mutex m_mutex; + std::jthread m_thread; mutable unsigned int handle; mutable std::map searchDescriptors;