X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..2196a3a0cdc5384c082febb7f4aa5994cc7d80db:/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h diff --git a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h index 290754fd..5a849366 100644 --- a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h +++ b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h @@ -26,13 +26,15 @@ #include "stg/logger.h" #include - -#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#pragma GCC diagnostic pop namespace STG { -struct Users; -struct Tariffs; +class Users; +class Tariffs; struct Admins; struct TraffCounter; struct Settings; @@ -61,7 +63,7 @@ private: DIVERT_CAP(const DIVERT_CAP & rvalue); DIVERT_CAP & operator=(const DIVERT_CAP & rvalue); - static void * Run(void *); + void Run(std::stop_token token) noexcept; int DivertCapOpen(); int DivertCapOpen(int n); @@ -76,9 +78,8 @@ private: mutable std::string errorStr; - pthread_t thread; + std::jthread m_thread; - bool nonstop; bool isRunning; STG::TraffCounter * traffCnt;