Use one-shot expirations instead of intervals for the libev backend

This commit is contained in:
Raoul Wols 2021-09-06 12:07:43 +02:00
parent cffbd346ae
commit b25c3f3ea8
No known key found for this signature in database
GPG Key ID: 9FFE06A0F6AAA2DF
1 changed files with 2 additions and 2 deletions

View File

@ -269,7 +269,7 @@ private:
} }
// reset the timer to trigger again later // reset the timer to trigger again later
_timer.repeat = std::min(_next, _expire) - now; ev_timer_set(&_timer, std::min(_next, _expire) - now, 0.0);
// restart the timer // restart the timer
ev_timer_again(_loop, &_timer); ev_timer_again(_loop, &_timer);
@ -366,7 +366,7 @@ private:
_expire = now + _timeout * 1.5; _expire = now + _timeout * 1.5;
// find the earliest thing that expires // find the earliest thing that expires
_timer.repeat = std::min(_next, _expire) - now; ev_timer_set(&_timer, std::min(_next, _expire) - now, 0.0);
// restart the timer // restart the timer
ev_timer_again(_loop, &_timer); ev_timer_again(_loop, &_timer);