callingExpiredTimers_ = true;
cancelingTimers_.clear();
for (const Entry& it : expired)
{
it.second->run();
}
callingExpiredTimers_ = false;
if you cancel the timer in callback, the next timer will still run. so you should try to judge timer if it is in cancelingTimers_ beforn callback
callingExpiredTimers_ = true;
cancelingTimers_.clear();
for (const Entry& it : expired)
{
// if it is in cancelingtimers
it.second->run();
}
callingExpiredTimers_ = false;
if you cancel the timer in callback, the next timer will still run. so you should try to judge timer if it is in cancelingTimers_ beforn callback