summaryrefslogtreecommitdiff
path: root/sysdep/unix/io-loop.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-10-04 15:40:52 +0200
committerMaria Matejka <mq@ucw.cz>2022-10-04 15:40:52 +0200
commitbecca314e2546d6005a23398ce2d3012d4b396cb (patch)
treebdd2f55e81d42e6a1108593840c9273106676e09 /sysdep/unix/io-loop.h
parent61c127c021ac34eba25d3245ccf8f9eb9dd352f5 (diff)
parent0072d11f3431165240656edf6ade473554b8747e (diff)
Merge commit '0072d11f' into tmp-learn
Diffstat (limited to 'sysdep/unix/io-loop.h')
-rw-r--r--sysdep/unix/io-loop.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/sysdep/unix/io-loop.h b/sysdep/unix/io-loop.h
new file mode 100644
index 00000000..31c40459
--- /dev/null
+++ b/sysdep/unix/io-loop.h
@@ -0,0 +1,43 @@
+/*
+ * BIRD -- I/O and event loop
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#ifndef _BIRD_SYSDEP_UNIX_IO_LOOP_H_
+#define _BIRD_SYSDEP_UNIX_IO_LOOP_H_
+
+#include "lib/rcu.h"
+
+struct birdloop
+{
+ pool *pool;
+
+ struct timeloop time;
+ event_list event_list;
+ list sock_list;
+ uint sock_num;
+
+ BUFFER(sock *) poll_sk;
+ BUFFER(struct pollfd) poll_fd;
+ u8 poll_changed;
+ u8 close_scheduled;
+
+ uint ping_pending;
+ _Atomic u32 ping_sent;
+ int wakeup_fds[2];
+
+ pthread_t thread_id;
+ pthread_attr_t thread_attr;
+
+ struct rcu_birdloop rcu;
+
+ uint links;
+
+ void (*stopped)(void *data);
+ void *stop_data;
+
+ struct birdloop *prev_loop;
+};
+
+#endif