diff --git a/lib/rotor.hpp b/lib/rotor.hpp index 2614580..c832df7 100644 --- a/lib/rotor.hpp +++ b/lib/rotor.hpp @@ -93,8 +93,10 @@ class rotor { { unique_lock te_l(te_m); - te_cv.wait(te_l, [this]{ return !tcores.empty(); }); - // calc_next(); + te_cv.wait(te_l, [this]{ return !tcores.empty() || rotating; }); + if (!rotating) { + break; + } next_tc = min_element( tcores.begin(), tcores.end(), [](shared_ptr a, shared_ptr b ) { @@ -131,7 +133,7 @@ class rotor { void remove(vector>::iterator it) { lock_guard lock(te_m); tcores.erase(it); - te_cv.notify_one(); + // te_cv.notify_one(); } public: