diff --git a/lib/io-loop.h b/lib/io-loop.h index e888b514..4b93919e 100644 --- a/lib/io-loop.h +++ b/lib/io-loop.h @@ -59,14 +59,6 @@ void birdloop_unlink(struct birdloop *loop); void birdloop_ping(struct birdloop *loop); -struct birdloop_flag_handler { - void (*hook)(struct birdloop_flag_handler *, u32 flags); - void *data; -}; - -void birdloop_flag(struct birdloop *loop, u32 flag); -void birdloop_flag_set_handler(struct birdloop *, struct birdloop_flag_handler *); - /* Setup sockets */ void birdloop_add_socket(struct birdloop *, struct birdsock *); void birdloop_remove_socket(struct birdloop *, struct birdsock *); diff --git a/nest/route.h b/nest/route.h index f398cb33..d92c4946 100644 --- a/nest/route.h +++ b/nest/route.h @@ -125,7 +125,6 @@ struct rtable_private { struct event *hcu_uncork_event; /* Helper event to schedule HCU on uncork */ struct timer *prune_timer; /* Timer for periodic pruning / GC */ struct event *prune_event; /* Event for prune execution */ - struct birdloop_flag_handler fh; /* Handler for simple events */ btime last_rt_change; /* Last time when route changed */ btime gc_time; /* Time of last GC */ uint gc_counter; /* Number of operations since last GC */ diff --git a/nest/rt-table.c b/nest/rt-table.c index 898d8b57..b70911ea 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2690,8 +2690,6 @@ rt_setup(pool *pp, struct rtable_config *cf) UNLOCK_DOMAIN(rtable, dom); - /* Setup the service thread flag handler */ - birdloop_flag_set_handler(t->loop, &t->fh); birdloop_leave(t->loop); return RT_PUB(t); diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index 96aab7e6..5934c129 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -188,34 +188,6 @@ birdloop_in_this_thread(struct birdloop *loop) return pthread_equal(pthread_self(), loop->thread->thread_id); } -void -birdloop_flag(struct birdloop *loop, u32 flag) -{ - atomic_fetch_or_explicit(&loop->flags, flag, memory_order_acq_rel); - birdloop_ping(loop); -} - -void -birdloop_flag_set_handler(struct birdloop *loop, struct birdloop_flag_handler *fh) -{ - ASSERT_DIE(birdloop_inside(loop)); - loop->flag_handler = fh; -} - -static int -birdloop_process_flags(struct birdloop *loop) -{ - if (!loop->flag_handler) - return 0; - - u32 flags = atomic_exchange_explicit(&loop->flags, 0, memory_order_acq_rel); - if (!flags) - return 0; - - loop->flag_handler->hook(loop->flag_handler, flags); - return 1; -} - /* * Wakeup code for birdloop */ @@ -1504,9 +1476,6 @@ birdloop_run(void *_loop) /* Run timers */ timers_fire(&loop->time, 0); - /* Run flag handlers */ - repeat += birdloop_process_flags(loop); - /* Run events */ repeat += ev_run_list(&loop->event_list); diff --git a/sysdep/unix/io-loop.h b/sysdep/unix/io-loop.h index 53d9f96b..71e5b109 100644 --- a/sysdep/unix/io-loop.h +++ b/sysdep/unix/io-loop.h @@ -58,8 +58,6 @@ struct birdloop _Atomic u32 thread_transition; #define LTT_PING 1 #define LTT_MOVE 2 - _Atomic u32 flags; - struct birdloop_flag_handler *flag_handler; void (*stopped)(void *data); void *stop_data;