summaryrefslogtreecommitdiff
path: root/sysdep/unix/io-loop.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-09-20 17:01:50 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-20 17:17:50 +0200
commit6768e0cf9e4b7befbc29f2d40a6b15e1198908f5 (patch)
treef6feb422d6c4e9a16b0a2210d4ff7c51b8ab496a /sysdep/unix/io-loop.h
parent4b4fe1bd65f0dcebe3ff51a395acf0fd21c46a5d (diff)
Pipe kick-and-drain packed into a neat structure and functions.
Diffstat (limited to 'sysdep/unix/io-loop.h')
-rw-r--r--sysdep/unix/io-loop.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdep/unix/io-loop.h b/sysdep/unix/io-loop.h
index aec7a409..29ca96d6 100644
--- a/sysdep/unix/io-loop.h
+++ b/sysdep/unix/io-loop.h
@@ -9,6 +9,16 @@
#include "lib/rcu.h"
+struct pipe
+{
+ int fd[2];
+};
+
+void pipe_new(struct pipe *);
+void pipe_pollin(struct pipe *, struct pollfd *);
+void pipe_drain(struct pipe *);
+void pipe_kick(struct pipe *);
+
struct birdloop
{
pool *pool;
@@ -25,7 +35,7 @@ struct birdloop
uint ping_pending;
_Atomic u32 ping_sent;
- int wakeup_fds[2];
+ struct pipe wakeup;
pthread_t thread_id;
pthread_attr_t thread_attr;