mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +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:
@@ -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
|
||||
*/
|
||||
@@ -1483,9 +1455,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);
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user