X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/085c36723242f7bd1e0fd9bf49b950da6cb96039..0c097ef3435d2a45c1ee4ac80f8bd3f254fb8df5:/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;