summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/io-loop.c9
-rw-r--r--sysdep/unix/io-loop.h4
2 files changed, 12 insertions, 1 deletions
diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c
index 3419d9d8..3e3fc31a 100644
--- a/sysdep/unix/io-loop.c
+++ b/sysdep/unix/io-loop.c
@@ -416,6 +416,7 @@ birdloop_free(struct birdloop *loop)
ASSERT_DIE(loop->links == 0);
ASSERT_DIE(pthread_equal(pthread_self(), loop->thread_id));
+ rcu_birdloop_stop(&loop->rcu);
pthread_attr_destroy(&loop->thread_attr);
domain_free(loop->time.domain);
@@ -505,6 +506,8 @@ birdloop_main(void *arg)
timer *t;
int rv, timeout;
+ rcu_birdloop_start(&loop->rcu);
+
btime loop_begin = current_time();
tmp_init(loop->pool);
@@ -568,4 +571,8 @@ birdloop_main(void *arg)
return NULL;
}
-
+void
+birdloop_yield(void)
+{
+ usleep(100);
+}
diff --git a/sysdep/unix/io-loop.h b/sysdep/unix/io-loop.h
index ca4322fc..31c40459 100644
--- a/sysdep/unix/io-loop.h
+++ b/sysdep/unix/io-loop.h
@@ -7,6 +7,8 @@
#ifndef _BIRD_SYSDEP_UNIX_IO_LOOP_H_
#define _BIRD_SYSDEP_UNIX_IO_LOOP_H_
+#include "lib/rcu.h"
+
struct birdloop
{
pool *pool;
@@ -28,6 +30,8 @@ struct birdloop
pthread_t thread_id;
pthread_attr_t thread_attr;
+ struct rcu_birdloop rcu;
+
uint links;
void (*stopped)(void *data);