summaryrefslogtreecommitdiff
path: root/test/bt-utils.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2021-06-19 20:50:18 +0200
committerMaria Matejka <mq@ucw.cz>2021-11-22 19:05:43 +0100
commit94eb0858c2b938549d9d1703c872c6149901e7dd (patch)
tree2eb0cff73002b4278916c1ad6865b7a85b680bd1 /test/bt-utils.c
parentc84ed603714db2c42a781f8dbb5b3fd540ff689f (diff)
Converting the former BFD loop to a universal IO loop and protocol loop.
There is a simple universal IO loop, taking care of events, timers and sockets. Primarily, one instance of a protocol should use exactly one IO loop to do all its work, as is now done in BFD. Contrary to previous versions, the loop is now launched and cleaned by the nest/proto.c code, allowing for a protocol to just request its own loop by setting the loop's lock order in config higher than the_bird. It is not supported nor checked if any protocol changed the requested lock order in reconfigure. No protocol should do it at all.
Diffstat (limited to 'test/bt-utils.c')
-rw-r--r--test/bt-utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/bt-utils.c b/test/bt-utils.c
index cbca3a6b..90815e77 100644
--- a/test/bt-utils.c
+++ b/test/bt-utils.c
@@ -53,16 +53,20 @@ cf_file_read(byte *dest, uint max_len, int fd)
return l;
}
+void resource_sys_init(void);
+
void
bt_bird_init(void)
{
+ resource_sys_init();
if(bt_verbose)
log_init_debug("");
log_switch(bt_verbose != 0, NULL, NULL);
+ the_bird_lock();
resource_init();
olock_init();
- timer_init();
+ birdloop_init();
io_init();
rt_init();
if_init();
@@ -79,6 +83,7 @@ void bt_bird_cleanup(void)
class_to_protocol[i] = NULL;
config = new_config = NULL;
+ the_bird_unlock();
}
static char *