- The `unique_lock` was manually unlocked before going out of scope,
causing a double unlock issue.
- This has been fixed by removing the explicit `unlock()` call.
- Additionally, `notify_emptied_cv.notify_all()` is now called without
holding the lock to avoid unnecessary cntention.
Signed-off-by: Eunju Yang <ej.yang@samsung.com>
}
void IterationQueue::markFilled(MarkableIteration *iteration) {
- std::unique_lock lg(empty_mutex);
- num_being_filled--;
- filled_q.push(iteration);
- lg.unlock();
+ {
+ std::lock_guard lg(empty_mutex);
+ --num_being_filled;
+ filled_q.push(iteration);
+ }
notify_emptied_cv.notify_all();
}