Skip to content

Commit

Permalink
fix: task_manager termination under Emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha authored Dec 22, 2023
1 parent cad5cce commit ff97fce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/runtime/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,11 @@ class task_manager {
unique_lock<mutex> lock(m_mutex);
m_shutting_down = true;
m_queue_cv.notify_all();
#ifndef LEAN_EMSCRIPTEN
// wait for all workers to finish
m_worker_finished_cv.wait(lock, [&]() { return m_num_std_workers + m_num_dedicated_workers == 0; });
// never seems to terminate under Emscripten
#endif
}

void enqueue(lean_task_object * t) {
Expand Down

0 comments on commit ff97fce

Please sign in to comment.