Skip to content
Snippets Groups Projects
Commit eda3c1a2 authored by Adrien Béraud's avatar Adrien Béraud Committed by Andreas Traczyk
Browse files

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: default avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 51c3ea0f
No related branches found
No related tags found
No related merge requests found
...@@ -127,10 +127,10 @@ private: ...@@ -127,10 +127,10 @@ private:
void reschedule(std::shared_ptr<RepeatedTask>, time_point t, duration dt); void reschedule(std::shared_ptr<RepeatedTask>, time_point t, duration dt);
std::atomic_bool running_ {true}; 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::thread thread_;
std::mutex jobLock_;
std::condition_variable cv_;
}; };
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment