summaryrefslogtreecommitdiff
path: root/sysdep/unix/io-loop.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-04-02 19:15:22 +0200
committerMaria Matejka <mq@ucw.cz>2023-04-04 17:00:59 +0200
commit836e857b3098f8962c621a33f7ae5b532cf512f3 (patch)
tree96c62361fd7b2dd57cecdf9d9b9323f8aa95f021 /sysdep/unix/io-loop.h
parent571c4f69bfbcf437d848b332bb2f4995fea2347d (diff)
Sockets: Unified API for main and other loops
Now sk_open() requires an explicit IO loop to open the socket in. Also specific functions for socket RX pause / resume are added to allow for BGP corking. And last but not least, socket reloop is now synchronous to resolve weird cases of the target loop stopping before actually picking up the relooped socket. Now the caller must ensure that both loops are locked while relooping, and this way all sockets always have their respective loop.
Diffstat (limited to 'sysdep/unix/io-loop.h')
-rw-r--r--sysdep/unix/io-loop.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sysdep/unix/io-loop.h b/sysdep/unix/io-loop.h
index e606f07e..7ec903af 100644
--- a/sysdep/unix/io-loop.h
+++ b/sysdep/unix/io-loop.h
@@ -22,6 +22,7 @@ struct pfd {
};
void sockets_prepare(struct birdloop *, struct pfd *);
+void socket_changed(struct birdsock *);
void pipe_new(struct pipe *);
void pipe_pollin(struct pipe *, struct pfd *);
@@ -40,12 +41,12 @@ struct birdloop
struct timeloop time;
event_list event_list;
list sock_list;
+ struct birdsock *sock_active;
int sock_num;
+ uint sock_changed;
uint ping_pending;
- uint links;
-
_Atomic u32 thread_transition;
#define LTT_PING 1
#define LTT_MOVE 2
@@ -66,8 +67,6 @@ struct bird_thread
{
node n;
- _Atomic u32 poll_changed;
-
struct pipe wakeup;
event_list priority_events;
@@ -83,6 +82,8 @@ struct bird_thread
struct pfd *pfd;
event cleanup_event;
+
+ int sock_changed;
};
#endif