mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
We need to replace nanosleeps with condition variables so that we can implement BeesContext::stop. Export the time calculation from sleep_for() into a new method called sleep_time(). If the thread executing RateLimiter::sleep_for() is interrupted, it will no longer be able to restart, as the sleep_time() method is destructive. This calls for further refactoring of sleep_time() into destructive and non-destructive parts; however, there are currently no users of sleep_for() which rely on being able to restart after being interrupted by a signal. Signed-off-by: Zygo Blaxell <bees@furryterror.org>