mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-23 02:01:55 +00:00
Removed the obsolete birdloop flagger
This was useful when events were locking. As now sending events is lockless, we can drop this obsolete routine for good.
This commit is contained in:
parent
feb16991ee
commit
929df85f1e
@ -59,14 +59,6 @@ void birdloop_unlink(struct birdloop *loop);
|
|||||||
|
|
||||||
void birdloop_ping(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 */
|
/* Setup sockets */
|
||||||
void birdloop_add_socket(struct birdloop *, struct birdsock *);
|
void birdloop_add_socket(struct birdloop *, struct birdsock *);
|
||||||
void birdloop_remove_socket(struct birdloop *, struct birdsock *);
|
void birdloop_remove_socket(struct birdloop *, struct birdsock *);
|
||||||
|
@ -125,7 +125,6 @@ struct rtable_private {
|
|||||||
struct event *hcu_uncork_event; /* Helper event to schedule HCU on uncork */
|
struct event *hcu_uncork_event; /* Helper event to schedule HCU on uncork */
|
||||||
struct timer *prune_timer; /* Timer for periodic pruning / GC */
|
struct timer *prune_timer; /* Timer for periodic pruning / GC */
|
||||||
struct event *prune_event; /* Event for prune execution */
|
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 last_rt_change; /* Last time when route changed */
|
||||||
btime gc_time; /* Time of last GC */
|
btime gc_time; /* Time of last GC */
|
||||||
uint gc_counter; /* Number of operations since last GC */
|
uint gc_counter; /* Number of operations since last GC */
|
||||||
|
@ -2690,8 +2690,6 @@ rt_setup(pool *pp, struct rtable_config *cf)
|
|||||||
|
|
||||||
UNLOCK_DOMAIN(rtable, dom);
|
UNLOCK_DOMAIN(rtable, dom);
|
||||||
|
|
||||||
/* Setup the service thread flag handler */
|
|
||||||
birdloop_flag_set_handler(t->loop, &t->fh);
|
|
||||||
birdloop_leave(t->loop);
|
birdloop_leave(t->loop);
|
||||||
|
|
||||||
return RT_PUB(t);
|
return RT_PUB(t);
|
||||||
|
@ -188,34 +188,6 @@ birdloop_in_this_thread(struct birdloop *loop)
|
|||||||
return pthread_equal(pthread_self(), loop->thread->thread_id);
|
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
|
* Wakeup code for birdloop
|
||||||
*/
|
*/
|
||||||
@ -1504,9 +1476,6 @@ birdloop_run(void *_loop)
|
|||||||
/* Run timers */
|
/* Run timers */
|
||||||
timers_fire(&loop->time, 0);
|
timers_fire(&loop->time, 0);
|
||||||
|
|
||||||
/* Run flag handlers */
|
|
||||||
repeat += birdloop_process_flags(loop);
|
|
||||||
|
|
||||||
/* Run events */
|
/* Run events */
|
||||||
repeat += ev_run_list(&loop->event_list);
|
repeat += ev_run_list(&loop->event_list);
|
||||||
|
|
||||||
|
@ -58,8 +58,6 @@ struct birdloop
|
|||||||
_Atomic u32 thread_transition;
|
_Atomic u32 thread_transition;
|
||||||
#define LTT_PING 1
|
#define LTT_PING 1
|
||||||
#define LTT_MOVE 2
|
#define LTT_MOVE 2
|
||||||
_Atomic u32 flags;
|
|
||||||
struct birdloop_flag_handler *flag_handler;
|
|
||||||
|
|
||||||
void (*stopped)(void *data);
|
void (*stopped)(void *data);
|
||||||
void *stop_data;
|
void *stop_data;
|
||||||
|
Loading…
Reference in New Issue
Block a user