git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'github/master'
[stg.git]
/
projects
/
stargazer
/
plugins
/
configuration
/
rpcconfig
/
rpcconfig.h
diff --git
a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h
b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h
index e7c800d5a9c6f640d6510bb9f2aad3b793812c43..f42114a56b879146441e1277b800fd4ab684331d 100644
(file)
--- a/
projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h
+++ b/
projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h
@@
-15,7
+15,10
@@
#include <map>
#include <vector>
#include <map>
#include <vector>
-#include <pthread.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#include <jthread.hpp>
+#pragma GCC diagnostic pop
#define RPC_CONFIG_VERSION "Stargazer RPC v. 0.2"
#define RPC_CONFIG_VERSION "Stargazer RPC v. 0.2"
@@
-23,8
+26,8
@@
namespace STG
{
struct Admins;
{
struct Admins;
-
struct
Tariffs;
-
struct
Users;
+
class
Tariffs;
+
class
Users;
struct Store;
}
struct Store;
}
@@
-75,7
+78,7
@@
public:
int Start() override;
int Stop() override;
int Reload(const STG::ModuleSettings & /*ms*/) override { return 0; }
int Start() override;
int Stop() override;
int Reload(const STG::ModuleSettings & /*ms*/) override { return 0; }
- bool IsRunning() override { return
running
&& !stopped; }
+ bool IsRunning() override { return
m_thread.joinable()
&& !stopped; }
const std::string & GetStrError() const override { return errorStr; }
std::string GetVersion() const override { return RPC_CONFIG_VERSION; }
const std::string & GetStrError() const override { return errorStr; }
std::string GetVersion() const override { return RPC_CONFIG_VERSION; }
@@
-93,7
+96,7
@@
private:
RPC_CONFIG(const RPC_CONFIG & rvalue);
RPC_CONFIG & operator=(const RPC_CONFIG & rvalue);
RPC_CONFIG(const RPC_CONFIG & rvalue);
RPC_CONFIG & operator=(const RPC_CONFIG & rvalue);
-
static void * Run(void *
);
+
void Run(std::stop_token token
);
std::string GetCookie() const;
void InitiateRegistry();
std::string GetCookie() const;
void InitiateRegistry();
@@
-107,9
+110,8
@@
private:
int fd;
xmlrpc_c::registry rpcRegistry;
xmlrpc_c::serverAbyss * rpcServer;
int fd;
xmlrpc_c::registry rpcRegistry;
xmlrpc_c::serverAbyss * rpcServer;
- bool running;
bool stopped;
bool stopped;
-
pthread_t ti
d;
+
std::jthread m_threa
d;
std::map<std::string,
ADMIN_INFO> cookies;
size_t dayFee;
std::map<std::string,
ADMIN_INFO> cookies;
size_t dayFee;