2013-09-16 23:57:40 +02:00
|
|
|
/*
|
|
|
|
* BIRD -- I/O and event loop
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
2013-09-10 12:09:36 +02:00
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
#ifndef _BIRD_SYSDEP_UNIX_IO_LOOP_H_
|
|
|
|
#define _BIRD_SYSDEP_UNIX_IO_LOOP_H_
|
2013-09-10 12:09:36 +02:00
|
|
|
|
2021-11-12 22:58:40 +01:00
|
|
|
#include "lib/rcu.h"
|
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
struct birdloop
|
|
|
|
{
|
|
|
|
pool *pool;
|
2013-09-16 23:57:40 +02:00
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
struct timeloop time;
|
|
|
|
event_list event_list;
|
|
|
|
list sock_list;
|
|
|
|
uint sock_num;
|
2013-09-16 23:57:40 +02:00
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
BUFFER(sock *) poll_sk;
|
|
|
|
BUFFER(struct pollfd) poll_fd;
|
|
|
|
u8 poll_changed;
|
|
|
|
u8 close_scheduled;
|
2013-09-10 12:09:36 +02:00
|
|
|
|
2022-07-28 19:49:03 +02:00
|
|
|
uint ping_pending;
|
2021-06-19 20:50:18 +02:00
|
|
|
_Atomic u32 ping_sent;
|
|
|
|
int wakeup_fds[2];
|
2013-09-10 12:09:36 +02:00
|
|
|
|
2022-07-28 19:49:03 +02:00
|
|
|
pthread_t thread_id;
|
|
|
|
pthread_attr_t thread_attr;
|
|
|
|
|
2021-11-12 22:58:40 +01:00
|
|
|
struct rcu_birdloop rcu;
|
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
uint links;
|
2013-11-19 22:33:48 +01:00
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
void (*stopped)(void *data);
|
|
|
|
void *stop_data;
|
2013-09-16 23:57:40 +02:00
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
struct birdloop *prev_loop;
|
|
|
|
};
|
2013-09-10 12:09:36 +02:00
|
|
|
|
2021-06-19 20:50:18 +02:00
|
|
|
#endif
|