fix(library/module): bug in next_task method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
c593247fcc
commit
be96dc2ddf
1 changed files with 2 additions and 2 deletions
|
@ -272,12 +272,12 @@ struct import_modules_fn {
|
||||||
while (true) {
|
while (true) {
|
||||||
check_interrupted();
|
check_interrupted();
|
||||||
unique_lock<mutex> lk(m_asynch_mutex);
|
unique_lock<mutex> lk(m_asynch_mutex);
|
||||||
if (m_all_modules_imported)
|
|
||||||
return optional<asynch_update_fn>();
|
|
||||||
if (!m_asynch_tasks.empty()) {
|
if (!m_asynch_tasks.empty()) {
|
||||||
asynch_update_fn r = m_asynch_tasks.back();
|
asynch_update_fn r = m_asynch_tasks.back();
|
||||||
m_asynch_tasks.pop_back();
|
m_asynch_tasks.pop_back();
|
||||||
return optional<asynch_update_fn>(r);
|
return optional<asynch_update_fn>(r);
|
||||||
|
} else if (m_all_modules_imported) {
|
||||||
|
return optional<asynch_update_fn>();
|
||||||
} else {
|
} else {
|
||||||
m_asynch_cv.wait(lk);
|
m_asynch_cv.wait(lk);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue