event/TimerEvent: use base_hook instead of member_hook
This commit is contained in:
		| @@ -66,9 +66,7 @@ class EventLoop final : SocketMonitor | ||||
|  | ||||
| 	using TimerSet = | ||||
| 		boost::intrusive::multiset<TimerEvent, | ||||
| 					   boost::intrusive::member_hook<TimerEvent, | ||||
| 									 TimerEvent::TimerSetHook, | ||||
| 									 &TimerEvent::timer_set_hook>, | ||||
| 					   boost::intrusive::base_hook<boost::intrusive::set_base_hook<>>, | ||||
| 					   boost::intrusive::compare<TimerCompare>, | ||||
| 					   boost::intrusive::constant_time_size<false>>; | ||||
| 	TimerSet timers; | ||||
|   | ||||
| @@ -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<void() noexcept> 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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann