| 1458 | |
| 1459 | template <typename T> |
| 1460 | SC::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 | |
| 1479 | SC::Result SC::AsyncEventLoop::Internal::close(AsyncEventLoop& eventLoop) |
| 1480 | { |
nothing calls this directly
no test coverage detected