- while (this->parmap.thread_counter < this->parmap.num_workers) {
- /* wait for all workers to be ready */
- done_cond.wait(lk);
- }
+ /* wait for all workers to be ready */
+ done_cond.wait(lk, [this]() { return this->parmap.thread_counter >= this->parmap.num_workers; });