MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / PoolThreadLoop

Method PoolThreadLoop

Libraries/unrar/threadpool.cpp:114–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114void ThreadPool::PoolThreadLoop()
115{
116 QueueEntry Task;
117 while (GetQueuedTask(&Task))
118 {
119 Task.Proc(Task.Param);
120
121 CriticalSectionStart(&CritSection);
122 if (--ActiveThreads == 0)
123 {
124#ifdef _WIN_ALL
125 SetEvent(NoneActive);
126#elif defined(_UNIX)
127 pthread_mutex_lock(&AnyActiveMutex);
128 AnyActive=false;
129 pthread_cond_signal(&AnyActiveCond);
130 pthread_mutex_unlock(&AnyActiveMutex);
131#endif
132 }
133 CriticalSectionEnd(&CritSection);
134 }
135}
136
137
138bool ThreadPool::GetQueuedTask(QueueEntry *Task)

Callers 1

PoolThreadMethod · 0.80

Calls 2

CriticalSectionStartFunction · 0.85
CriticalSectionEndFunction · 0.85

Tested by

no test coverage detected