MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / waitForThreadPoolTasks

Method waitForThreadPoolTasks

Libraries/Async/Async.cpp:1460–1477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1458
1459template <typename T>
1460SC::Result SC::AsyncEventLoop::Internal::waitForThreadPoolTasks(IntrusiveDoubleLinkedList<T>& linkedList)
1461{
1462 Result res = Result(true);
1463 // Wait for all thread pool tasks
1464 for (T* it = linkedList.front; it != nullptr; it = static_cast<T*>(it->next))
1465 {
1466 AsyncTaskSequence* asyncTask = it->getTask();
1467 if (asyncTask != nullptr)
1468 {
1469 if (not asyncTask->threadPool->waitForTask(asyncTask->task))
1470 {
1471 res = Result::Error("Threadpool was already stopped");
1472 }
1473 it->flags &= ~AsyncEventLoop::Internal::Flag_AsyncTaskSequenceInUse;
1474 }
1475 }
1476 return res;
1477}
1478
1479SC::Result SC::AsyncEventLoop::Internal::close(AsyncEventLoop& eventLoop)
1480{

Callers

nothing calls this directly

Calls 4

getTaskMethod · 0.80
waitForTaskMethod · 0.80
ResultClass · 0.70
ErrorEnum · 0.50

Tested by

no test coverage detected