fix: Improve Repeat implementation (#1775)

This commit is contained in:
Sergey Kuznetsov
2024-12-11 15:07:48 +00:00
committed by GitHub
parent c41399ef8e
commit b53cfd0ec1
3 changed files with 41 additions and 14 deletions

View File

@@ -27,12 +27,16 @@ Repeat::Repeat(boost::asio::io_context& ioc) : timer_(ioc)
{
}
Repeat::~Repeat()
{
*stopped_ = true;
}
void
Repeat::stop()
{
stopping_ = true;
*stopped_ = true;
timer_.cancel();
semaphore_.acquire();
}
} // namespace util