diff options
Diffstat (limited to 'zebra/zebra_ptm.c')
| -rw-r--r-- | zebra/zebra_ptm.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 9a3b567b5a..1e7b38086b 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); @@ -218,7 +215,7 @@ static int zebra_ptm_send_message(char *data, int size) ptm_cb.reconnect_time, &ptm_cb.t_timer); return -1; case BUFFER_EMPTY: - THREAD_OFF(ptm_cb.t_write); + thread_cancel(&ptm_cb.t_write); break; case BUFFER_PENDING: thread_add_write(zrouter.master, zebra_ptm_flush_messages, NULL, |
