mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 04:52:01 +00:00
Merge pull request #9811 from donaldsharp/rib_update_fix
Various thread functional fixes
This commit is contained in:
commit
5db95752c0
@ -2059,3 +2059,11 @@ void debug_signals(const sigset_t *sigs)
|
||||
|
||||
zlog_debug("%s: %s", __func__, buf);
|
||||
}
|
||||
|
||||
bool thread_is_scheduled(struct thread *thread)
|
||||
{
|
||||
if (thread == NULL)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -273,6 +273,7 @@ extern pthread_key_t thread_current;
|
||||
extern char *thread_timer_to_hhmmss(char *buf, int buf_size,
|
||||
struct thread *t_timer);
|
||||
|
||||
extern bool thread_is_scheduled(struct thread *thread);
|
||||
/* Debug signal mask */
|
||||
void debug_signals(const sigset_t *sigs);
|
||||
|
||||
|
@ -3890,14 +3890,16 @@ void rib_update(enum rib_update_event event)
|
||||
{
|
||||
struct rib_update_ctx *ctx;
|
||||
|
||||
ctx = rib_update_ctx_init(0, event);
|
||||
if (thread_is_scheduled(t_rib_update_threads[event]))
|
||||
return;
|
||||
|
||||
ctx = rib_update_ctx_init(0, event);
|
||||
ctx->vrf_all = true;
|
||||
|
||||
if (!thread_add_event(zrouter.master, rib_update_handler, ctx, 0,
|
||||
&t_rib_update_threads[event]))
|
||||
rib_update_ctx_fini(&ctx); /* Already scheduled */
|
||||
else if (IS_ZEBRA_DEBUG_EVENT)
|
||||
thread_add_event(zrouter.master, rib_update_handler, ctx, 0,
|
||||
&t_rib_update_threads[event]);
|
||||
|
||||
if (IS_ZEBRA_DEBUG_EVENT)
|
||||
zlog_debug("%s: Scheduled VRF (ALL), event %s", __func__,
|
||||
rib_update_event2str(event));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user