From cd9ff9d9b004e430bd6d92e753ea53f1f9a10752 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 8 Oct 2020 16:57:32 +0200 Subject: [PATCH] event/TimerEvent: use base_hook instead of member_hook --- src/event/Loop.hxx | 4 +--- src/event/TimerEvent.hxx | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx index 110499d94..f5cb1b608 100644 --- a/src/event/Loop.hxx +++ b/src/event/Loop.hxx @@ -66,9 +66,7 @@ class EventLoop final : SocketMonitor using TimerSet = boost::intrusive::multiset, + boost::intrusive::base_hook>, boost::intrusive::compare, boost::intrusive::constant_time_size>; TimerSet timers; diff --git a/src/event/TimerEvent.hxx b/src/event/TimerEvent.hxx index 6bdfd9326..c47314086 100644 --- a/src/event/TimerEvent.hxx +++ b/src/event/TimerEvent.hxx @@ -36,12 +36,11 @@ class EventLoop; * thread that runs the #EventLoop, except where explicitly documented * as thread-safe. */ -class TimerEvent final { +class TimerEvent final + : public boost::intrusive::set_base_hook<> +{ friend class EventLoop; - typedef boost::intrusive::set_member_hook<> TimerSetHook; - TimerSetHook timer_set_hook; - EventLoop &loop; typedef BoundMethod Callback; @@ -67,7 +66,7 @@ public: } bool IsActive() const noexcept { - return timer_set_hook.is_linked(); + return is_linked(); } void Schedule(std::chrono::steady_clock::duration d) noexcept;