diff --git a/src/crimson/os/alienstore/thread_pool.h b/src/crimson/os/alienstore/thread_pool.h index db44bd02f9e..fd22c9743db 100644 --- a/src/crimson/os/alienstore/thread_pool.h +++ b/src/crimson/os/alienstore/thread_pool.h @@ -90,10 +90,14 @@ public: return work_item; } void stop() { + std::unique_lock lock{mutex}; stopping = true; cond.notify_all(); } void push_back(WorkItem* work_item) { + // XXX: oops, we can stall the reactor! + // TODO: switch to boost::lockfree. + std::unique_lock lock{mutex}; pending.push_back(work_item); cond.notify_one(); }