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 /zebra/zebra_ptm.c | |
| 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 'zebra/zebra_ptm.c')
| -rw-r--r-- | zebra/zebra_ptm.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 9a3b567b5a..013cb6449c 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -156,13 +156,10 @@ void zebra_ptm_finish(void) if (ptm_cb.in_data) free(ptm_cb.in_data); - /* Release threads. */ - if (ptm_cb.t_read) - thread_cancel(ptm_cb.t_read); - if (ptm_cb.t_write) - thread_cancel(ptm_cb.t_write); - if (ptm_cb.t_timer) - thread_cancel(ptm_cb.t_timer); + /* Cancel events. */ + thread_cancel(&ptm_cb.t_read); + thread_cancel(&ptm_cb.t_write); + thread_cancel(&ptm_cb.t_timer); if (ptm_cb.wb) buffer_free(ptm_cb.wb); |
