event/Loop: manage all SocketEvents in a linked list

Not only those which are "ready".
This commit is contained in:
Max Kellermann
2020-10-18 19:39:21 +02:00
parent dd94f97572
commit a14997ffb8
4 changed files with 33 additions and 20 deletions
+1 -4
View File
@@ -45,14 +45,11 @@ class EventLoop;
* thread that runs the #EventLoop, except where explicitly documented
* as thread-safe.
*/
class SocketEvent {
class SocketEvent final : public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>> {
friend class EventLoop;
EventLoop &loop;
using ReadyListHook = boost::intrusive::list_member_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>>;
ReadyListHook ready_siblings;
using Callback = BoundMethod<void(unsigned events) noexcept>;
const Callback callback;