fix(util/worker_queue): bug in join method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
7ccb9a389c
commit
585127ef66
1 changed files with 13 additions and 13 deletions
|
@ -93,12 +93,12 @@ public:
|
|||
std::vector<T> const & join() {
|
||||
lean_assert(!m_done);
|
||||
m_done = true;
|
||||
#ifndef LEAN_MULTI_THREAD
|
||||
if (m_threads.empty()) {
|
||||
for (auto const & fn : m_todo) {
|
||||
m_result.push_back(fn());
|
||||
}
|
||||
m_todo.clear();
|
||||
#else
|
||||
} else {
|
||||
m_todo_cv.notify_all();
|
||||
for (thread_ptr & t : m_threads)
|
||||
t->join();
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
m_thread_exceptions[m_failed_thread]->rethrow();
|
||||
if (m_interrupted)
|
||||
throw interrupted();
|
||||
#endif
|
||||
}
|
||||
return m_result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue