diff options
-rw-r--r-- | Rx/v2/src/rxcpp/schedulers/rx-newthread.hpp | 5 |
1 files 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; |