forked from awwit/httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServerControls.h
More file actions
37 lines (29 loc) · 891 Bytes
/
ServerControls.h
File metadata and controls
37 lines (29 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "../utils/Event.h"
#include "../system/Cache.h"
#include <atomic>
#include <csignal>
namespace HttpServer
{
class ServerControls
{
public:
Utils::Event *eventProcessQueue;
Utils::Event *eventNotFullQueue;
Utils::Event *eventUpdateModule;
System::CachePaddingSize<sizeof(void *) * 3> padding_1;
// Флаг, означающий - активированы ли главные циклы сервера
// (с помощью этого флага можно деактивировать циклы, чтобы завершить работу сервера)
sig_atomic_t process_flag;
sig_atomic_t restart_flag;
public:
ServerControls();
~ServerControls();
void clear();
void setProcess(const bool flag = true);
void stopProcess();
void setRestart(const bool flag = true);
void setUpdateModule();
void setProcessQueue();
};
}