fix deadlock in multiqueue reset method.

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent 20db13abc7
commit c87197dd4e

@ -115,12 +115,10 @@ public:
running = false; running = false;
while (nof_threads_waiting > 0) { while (nof_threads_waiting > 0) {
uint32_t size = queues.size(); uint32_t size = queues.size();
lock.unlock();
cv_empty.notify_one(); cv_empty.notify_one();
for (uint32_t i = 0; i < size; ++i) { for (uint32_t i = 0; i < size; ++i) {
queues[i].cv_full.notify_all(); queues[i].cv_full.notify_all();
} }
lock.lock();
// wait for all threads to unblock // wait for all threads to unblock
cv_exit.wait(lock); cv_exit.wait(lock);
} }

Loading…
Cancel
Save