X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b27841d687ec9e84983340b5581376dfb24010ea..1cb912e4f90473f78d2f0f10ab5c9b2c5bd36440:/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h?ds=sidebyside 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;