diff --git a/src/Common/Scheduler/SchedulerRoot.h b/src/Common/Scheduler/SchedulerRoot.h index 7d1c81042f2c..9d5f66e0320b 100644 --- a/src/Common/Scheduler/SchedulerRoot.h +++ b/src/Common/Scheduler/SchedulerRoot.h @@ -251,9 +251,11 @@ class SchedulerRoot final : public ISchedulerNode } Resource * current = nullptr; // round-robin pointer - std::unordered_map children; // resources by pointer std::atomic stop_flag = false; EventQueue events; + /// Resources by pointer. Must be destroyed before the "events", + /// because the descructor of ISchedulerNode might access the mutex in that queue. + std::unordered_map children; ThreadFromGlobalPool scheduler; };