-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTHCManager.h
More file actions
59 lines (42 loc) · 1.07 KB
/
THCManager.h
File metadata and controls
59 lines (42 loc) · 1.07 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef THCManager_h
#define THCManager_h
#include <list>
#include <pthread.h>
#include <string>
namespace ThreadCommand {
class THCCommand;
class THCManager {
public:
//list_thread 락
pthread_mutex_t mutex;
typedef struct ThreadCategory {
std::string category;
float priotiry;
std::list<THCCommand*> list_command;
void* reference;
void* (*UpdatePrev)(void*);
void* (*UpdateNext)(void*);
pthread_t t_id;
//THCCommand 락
pthread_mutex_t mutex;
//list_command의 사이즈 락
pthread_mutex_t mutex_size;
} ThreadCategory;
private:
THCManager();
~THCManager();
std::list<ThreadCategory> list_thread;
static void* RunLoop(void*);
public:
static THCManager* Share();
void Update();
bool AddCommand(std::string _category, THCCommand* _command);
bool SetCategory(std::string _category, float _priotiry,
void* reference,
void* (*UpdatePrev)(void*),
void* (*UpdateNext)(void*));
ThreadCategory GetCategoryList(std::string _category);
friend class THCCommand;
};
}
#endif