diff options
author | Maria Matejka <mq@ucw.cz> | 2021-11-12 22:58:40 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-08-02 10:00:21 +0200 |
commit | 058ed711397df75350d905fc135758a6470c0143 (patch) | |
tree | cb779bc2414645de59b2d80f9b08bbe58772f8d1 /sysdep/unix/io-loop.c | |
parent | f1d6c66a78758449f00ed709891e24ab3571cc9c (diff) |
Introducing basic RCU primitives for lock-less shared data structures
Diffstat (limited to 'sysdep/unix/io-loop.c')
-rw-r--r-- | sysdep/unix/io-loop.c | 9 |
1 files changed, 8 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); +} |