diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-07-17 17:09:51 -0400 |
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2020-10-23 12:16:52 -0400 |
| commit | 5047884528ec263215504cb5df12ebd2422cc392 (patch) | |
| tree | 952121f1a904ef9c86c1f7336a3aae757eeb3434 /ldpd/ldpe.c | |
| parent | b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 (diff) | |
*: unify thread/event cancel macros
Replace all lib/thread cancel macros, use thread_cancel()
everywhere. Only the THREAD_OFF macro and thread_cancel() api are
supported. Also adjust thread_cancel_async() to NULL caller's pointer (if
present).
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'ldpd/ldpe.c')
| -rw-r--r-- | ldpd/ldpe.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c index d3374a62db..ffc1d17f51 100644 --- a/ldpd/ldpe.c +++ b/ldpd/ldpe.c @@ -208,7 +208,7 @@ ldpe_shutdown(void) #ifdef __OpenBSD__ if (sysdep.no_pfkey == 0) { - THREAD_READ_OFF(pfkey_ev); + thread_cancel(&pfkey_ev); close(global.pfkeysock); } #endif @@ -580,8 +580,8 @@ ldpe_dispatch_main(struct thread *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_READ_OFF(iev->ev_read); - THREAD_WRITE_OFF(iev->ev_write); + thread_cancel(&iev->ev_read); + thread_cancel(&iev->ev_write); ldpe_shutdown(); } @@ -719,8 +719,8 @@ ldpe_dispatch_lde(struct thread *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_READ_OFF(iev->ev_read); - THREAD_WRITE_OFF(iev->ev_write); + thread_cancel(&iev->ev_read); + thread_cancel(&iev->ev_write); ldpe_shutdown(); } @@ -778,14 +778,14 @@ ldpe_close_sockets(int af) af_global = ldp_af_global_get(&global, af); /* discovery socket */ - THREAD_READ_OFF(af_global->disc_ev); + thread_cancel(&af_global->disc_ev); if (af_global->ldp_disc_socket != -1) { close(af_global->ldp_disc_socket); af_global->ldp_disc_socket = -1; } /* extended discovery socket */ - THREAD_READ_OFF(af_global->edisc_ev); + thread_cancel(&af_global->edisc_ev); if (af_global->ldp_edisc_socket != -1) { close(af_global->ldp_edisc_socket); af_global->ldp_edisc_socket = -1; |
