From f38fb8e3c30b01b07c57e08039b2942f1685224d Mon Sep 17 00:00:00 2001 From: Konstantin Munichev Date: Fri, 26 Apr 2019 16:12:41 +0300 Subject: Fix address sanitizer issue in new_worker Signed-off-by: Konstantin Munichev --- Rx/v2/src/rxcpp/schedulers/rx-newthread.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Rx/v2/src/rxcpp/schedulers/rx-newthread.hpp b/Rx/v2/src/rxcpp/schedulers/rx-newthread.hpp index 5145e92..1500b25 100644 --- a/Rx/v2/src/rxcpp/schedulers/rx-newthread.hpp +++ b/Rx/v2/src/rxcpp/schedulers/rx-newthread.hpp @@ -109,8 +109,9 @@ private: keepAlive->q.pop(); continue; } - if (clock_type::now() < peek.when) { - keepAlive->wake.wait_until(guard, peek.when); + auto when = peek.when; + if (clock_type::now() < when) { + keepAlive->wake.wait_until(guard, when); continue; } auto what = peek.what; -- cgit v1.2.3