X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..90b793eb07dc190eeb1144a1da079de760d17c36:/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;