forked from uroni/urbackup_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectThread.h
More file actions
44 lines (31 loc) · 753 Bytes
/
SelectThread.h
File metadata and controls
44 lines (31 loc) · 753 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
38
39
40
41
42
43
44
#ifndef SELECTTHREAD_H
#define SELECTTHREAD_H
#include "Interface/Thread.h"
#include "Interface/Mutex.h"
#include "Interface/Condition.h"
#include <deque>
#include <vector>
#include "types.h"
class CClient;
class CWorkerThread;
const size_t max_clients=60;
class CSelectThread : public IThread
{
public:
CSelectThread(_u32 pWorkerThreadsPerMaster);
~CSelectThread();
void operator()();
bool AddClient(CClient *client);
bool RemoveClient(CClient *client);
size_t FreeClients(void);
void WakeUp(void);
private:
void FindWorker(CClient *client);
std::deque<CClient*> clients;
IMutex *mutex;
ICondition* cond;
IMutex *stop_mutex;
ICondition *stop_cond;
bool run;
};
#endif //SELECTTHREAD_H