Commit eda3c1a2 authored by Adrien Béraud's avatar Adrien Béraud Committed by Andreas Traczyk

scheduled_executor: initialize mutex before thread

Fix race condition where the thread might start before the mutex is properly initialized

Change-Id: I47c6947873b9e1e7aef576bf7d2ba79cc9ad1e57
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <>
parent 51c3ea0f
......@@ -127,10 +127,10 @@ private:
void reschedule(std::shared_ptr<RepeatedTask>, time_point t, duration dt);
std::atomic_bool running_ {true};
std::map<time_point, std::vector<Job>> jobs_;
std::map<time_point, std::vector<Job>> jobs_ {};
std::mutex jobLock_ {};
std::condition_variable cv_ {};
std::thread thread_;
std::mutex jobLock_;
std::condition_variable cv_;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment