diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-07-06 12:55:03 -0400 | 
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2020-10-23 08:59:34 -0400 | 
| commit | b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 (patch) | |
| tree | b5ef6dcab41d9da516a6ff044056e0faca7b35da /babeld | |
| parent | 90a65457d12d8d90bf47eab1a4bb5446b3810d96 (diff) | |
* : update signature of thread_cancel api
Change thread_cancel to take a ** to an event, NULL-check
before dereferencing, and NULL the caller's pointer. Update
many callers to use the new signature.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'babeld')
| -rw-r--r-- | babeld/babeld.c | 14 | 
1 files changed, 4 insertions, 10 deletions
diff --git a/babeld/babeld.c b/babeld/babeld.c index 09955cfbef..895ede7040 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -317,13 +317,9 @@ babel_clean_routing_process(void)      flush_all_routes();      babel_interface_close_all(); -    /* cancel threads */ -    if (babel_routing_process->t_read != NULL) { -        thread_cancel(babel_routing_process->t_read); -    } -    if (babel_routing_process->t_update != NULL) { -        thread_cancel(babel_routing_process->t_update); -    } +    /* cancel events */ +    thread_cancel(&babel_routing_process->t_read); +    thread_cancel(&babel_routing_process->t_update);      distribute_list_delete(&babel_routing_process->distribute_ctx);      XFREE(MTYPE_BABEL, babel_routing_process); @@ -503,9 +499,7 @@ static void  babel_set_timer(struct timeval *timeout)  {      long msecs = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; -    if (babel_routing_process->t_update != NULL) { -        thread_cancel(babel_routing_process->t_update); -    } +    thread_cancel(&(babel_routing_process->t_update));      thread_add_timer_msec(master, babel_main_loop, NULL, msecs, &babel_routing_process->t_update);  }  | 
