X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/0907aa4037b12b6b88ee24495d4577a064d4f8db..bc6cac0e474dfe2feb4983aef98f99e23a98ffc4:/projects/stargazer/plugins/capture/ether_linux/ether_cap.h

diff --git a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h b/projects/stargazer/plugins/capture/ether_linux/ether_cap.h
index cf776a45..d50923d6 100644
--- a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h
+++ b/projects/stargazer/plugins/capture/ether_linux/ether_cap.h
@@ -25,14 +25,16 @@
 
 #pragma once
 
-#include <pthread.h>
-
-#include <string>
-
 #include "stg/plugin.h"
 #include "stg/module_settings.h"
 #include "stg/logger.h"
 
+#include <string>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#include <jthread.hpp>
+#pragma GCC diagnostic pop
+
 namespace STG
 {
 
@@ -66,15 +68,14 @@ private:
     ETHER_CAP(const ETHER_CAP & rvalue);
     ETHER_CAP & operator=(const ETHER_CAP & rvalue);
 
-    static void *       Run(void *);
+    void                Run(std::stop_token token);
     int                 EthCapOpen();
     int                 EthCapClose();
     int                 EthCapRead(void * buffer, int blen, char ** iface);
 
     mutable std::string errorStr;
 
-    pthread_t           thread;
-    bool                nonstop;
+    std::jthread        m_thread;
     bool                isRunning;
     int                 capSock;