0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-21 04:45:21 +00:00
bird/sysdep/unix/io-loop.h
Maria Matejka 385b3ea395 For safer memory allocations, resources are bound to loops.
Also all loops have their basic resource pool for allocations which are
auto-freed when the loop is stopping.
2021-11-30 21:38:25 +01:00

39 lines
590 B
C

/*
* 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_
struct birdloop
{
resource r;
pool *pool;
pool *parent;
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;
_Atomic u32 ping_sent;
int wakeup_fds[2];
uint links;
void (*stopped)(void *data);
void *stop_data;
struct birdloop *prev_loop;
};
#endif