Repository navigation
Expand file tree
/
Copy paththreadpool.ipp
More file actions
92 lines (73 loc) · 1.42 KB
/
Copy paththreadpool.ipp
File metadata and controls
92 lines (73 loc) · 1.42 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
namespace KBEngine {
namespace thread
{
INLINE bool ThreadPool::isInitialize(void)const
{
return isInitialize_;
}
INLINE bool ThreadPool::isBusy(void)const
{
return bufferedTaskList_.size() > THREAD_BUSY_SIZE;
}
INLINE bool ThreadPool::isThreadCountMax(void)const
{
return currentThreadCount_ >= maxThreadCount_;
}
INLINE uint32 ThreadPool::getCurrentThreadCount(void)const
{
return currentThreadCount_;
}
INLINE uint32 ThreadPool::getCurrentFreeThreadCount(void)const
{
return currentFreeThreadCount_;
}
INLINE bool ThreadPool::isDestroyed()const
{
return isDestroyed_;
}
ThreadPool* TPThread::threadPool()
{
return threadPool_;
}
INLINE uint32 ThreadPool::bufferTaskSize()const
{
return bufferedTaskList_.size();
}
INLINE std::queue<thread::TPTask*>& ThreadPool::bufferedTaskList()
{
return bufferedTaskList_;
}
INLINE void ThreadPool::lockBufferedTaskList()
{
THREAD_MUTEX_LOCK(bufferedTaskList_mutex_);
}
INLINE void ThreadPool::unlockBufferedTaskList()
{
THREAD_MUTEX_UNLOCK(bufferedTaskList_mutex_);
}
INLINE uint32 ThreadPool::finiTaskSize()const
{
return finiTaskList_.size();
}
INLINE THREAD_ID TPThread::getID(void)const
{
return tidp_;
}
INLINE void TPThread::setID(THREAD_ID tidp)
{
tidp_ = tidp;
}
INLINE TPTask* TPThread::getTask(void)const
{
return currTask_;
}
INLINE void TPThread::setTask(TPTask* tpt)
{
currTask_ = tpt;
}
INLINE int TPThread::getState(void)const
{
return state_;
}
}
}