#include "stg/logger.h"
#include <string>
-
-#include <pthread.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#include <jthread.hpp>
+#pragma GCC diagnostic pop
namespace STG
{
-struct Users;
-struct Tariffs;
+class Users;
+class Tariffs;
struct Admins;
struct TraffCounter;
struct Settings;
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);
mutable std::string errorStr;
- pthread_t thread;
+ std::jthread m_thread;
- bool nonstop;
bool isRunning;
STG::TraffCounter * traffCnt;