MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ~Coordinator

Method ~Coordinator

src/common/Task.cpp:173–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171/// class Coordinator
172
173Coordinator::~Coordinator()
174{
175 MutexLockGuard guard(m_mutex, FB_FUNCTION);
176
177 for (WorkerThread** p = m_activeThreads.begin(); p < m_activeThreads.end(); p++)
178 (*p)->shutdown(false);
179
180 while (!m_activeThreads.isEmpty())
181 {
182 WorkerThread* thd = m_activeThreads.pop();
183 {
184 MutexUnlockGuard unlock(m_mutex, FB_FUNCTION);
185 thd->shutdown(true);
186 }
187 delete thd;
188 }
189
190 while (!m_idleThreads.isEmpty())
191 {
192 WorkerThread* thd = m_idleThreads.pop();
193 {
194 MutexUnlockGuard unlock(m_mutex, FB_FUNCTION);
195 thd->shutdown(true);
196 }
197 delete thd;
198 }
199
200 while (!m_activeWorkers.isEmpty())
201 {
202 Worker* w = m_activeWorkers.back();
203
204 MutexUnlockGuard unlock(m_mutex, FB_FUNCTION);
205 w->waitFor(-1);
206 }
207
208 while (!m_idleWorkers.isEmpty())
209 {
210 Worker* w = m_idleWorkers.pop();
211 delete w;
212 }
213}
214
215void Coordinator::runSync(Task* task)
216{

Callers

nothing calls this directly

Calls 7

beginMethod · 0.45
endMethod · 0.45
shutdownMethod · 0.45
isEmptyMethod · 0.45
popMethod · 0.45
backMethod · 0.45
waitForMethod · 0.45

Tested by

no test coverage detected