X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b27841d687ec9e84983340b5581376dfb24010ea..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 04e21948..5a849366 100644 --- a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h +++ b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h @@ -26,8 +26,10 @@ #include "stg/logger.h" #include - -#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#pragma GCC diagnostic pop namespace STG { @@ -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;