summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-07-21 14:26:43 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-07-21 14:30:50 +0200
commit2783a6921c8fd3917caa539df82e0d9f2a23eb0c (patch)
treed66407b5a832fe546455929c48511154d7a98edc
parentisisd: Convert thread_cancel to THREAD_OFF (diff)
downloadfrr-2783a6921c8fd3917caa539df82e0d9f2a23eb0c.tar.xz
frr-2783a6921c8fd3917caa539df82e0d9f2a23eb0c.zip
ldpd: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r--ldpd/accept.c6
-rw-r--r--ldpd/adjacency.c8
-rw-r--r--ldpd/control.c4
-rw-r--r--ldpd/interface.c4
-rw-r--r--ldpd/lde.c8
-rw-r--r--ldpd/lde_lib.c4
-rw-r--r--ldpd/ldpd.c14
-rw-r--r--ldpd/ldpe.c14
-rw-r--r--ldpd/neighbor.c18
-rw-r--r--ldpd/packet.c6
10 files changed, 43 insertions, 43 deletions
diff --git a/ldpd/accept.c b/ldpd/accept.c
index 2999a35c0..1a04c563c 100644
--- a/ldpd/accept.c
+++ b/ldpd/accept.c
@@ -72,7 +72,7 @@ accept_del(int fd)
LIST_FOREACH(av, &accept_queue.queue, entry)
if (av->fd == fd) {
log_debug("%s: %d removed from queue", __func__, fd);
- thread_cancel(&av->ev);
+ THREAD_OFF(av->ev);
LIST_REMOVE(av, entry);
free(av);
return;
@@ -92,7 +92,7 @@ accept_unpause(void)
{
if (accept_queue.evt != NULL) {
log_debug(__func__);
- thread_cancel(&accept_queue.evt);
+ THREAD_OFF(accept_queue.evt);
accept_arm();
}
}
@@ -111,7 +111,7 @@ accept_unarm(void)
{
struct accept_ev *av;
LIST_FOREACH(av, &accept_queue.queue, entry)
- thread_cancel(&av->ev);
+ THREAD_OFF(av->ev);
}
static void accept_cb(struct thread *thread)
diff --git a/ldpd/adjacency.c b/ldpd/adjacency.c
index 04a24242d..8caa3c4e2 100644
--- a/ldpd/adjacency.c
+++ b/ldpd/adjacency.c
@@ -196,7 +196,7 @@ static void adj_itimer(struct thread *thread)
void
adj_start_itimer(struct adj *adj)
{
- thread_cancel(&adj->inactivity_timer);
+ THREAD_OFF(adj->inactivity_timer);
adj->inactivity_timer = NULL;
thread_add_timer(master, adj_itimer, adj, adj->holdtime,
&adj->inactivity_timer);
@@ -205,7 +205,7 @@ adj_start_itimer(struct adj *adj)
void
adj_stop_itimer(struct adj *adj)
{
- thread_cancel(&adj->inactivity_timer);
+ THREAD_OFF(adj->inactivity_timer);
}
/* targeted neighbors */
@@ -354,7 +354,7 @@ static void tnbr_hello_timer(struct thread *thread)
static void
tnbr_start_hello_timer(struct tnbr *tnbr)
{
- thread_cancel(&tnbr->hello_timer);
+ THREAD_OFF(tnbr->hello_timer);
tnbr->hello_timer = NULL;
thread_add_timer(master, tnbr_hello_timer, tnbr, tnbr_get_hello_interval(tnbr),
&tnbr->hello_timer);
@@ -363,7 +363,7 @@ tnbr_start_hello_timer(struct tnbr *tnbr)
static void
tnbr_stop_hello_timer(struct tnbr *tnbr)
{
- thread_cancel(&tnbr->hello_timer);
+ THREAD_OFF(tnbr->hello_timer);
}
struct ctl_adj *
diff --git a/ldpd/control.c b/ldpd/control.c
index 376f488bd..09e91217a 100644
--- a/ldpd/control.c
+++ b/ldpd/control.c
@@ -180,8 +180,8 @@ control_close(int fd)
msgbuf_clear(&c->iev.ibuf.w);
TAILQ_REMOVE(&ctl_conns, c, entry);
- thread_cancel(&c->iev.ev_read);
- thread_cancel(&c->iev.ev_write);
+ THREAD_OFF(c->iev.ev_read);
+ THREAD_OFF(c->iev.ev_write);
close(c->iev.ibuf.fd);
accept_unpause();
free(c);
diff --git a/ldpd/interface.c b/ldpd/interface.c
index ddf6c395a..392e25470 100644
--- a/ldpd/interface.c
+++ b/ldpd/interface.c
@@ -467,7 +467,7 @@ static void if_hello_timer(struct thread *thread)
static void
if_start_hello_timer(struct iface_af *ia)
{
- thread_cancel(&ia->hello_timer);
+ THREAD_OFF(ia->hello_timer);
thread_add_timer(master, if_hello_timer, ia, if_get_hello_interval(ia),
&ia->hello_timer);
}
@@ -475,7 +475,7 @@ if_start_hello_timer(struct iface_af *ia)
static void
if_stop_hello_timer(struct iface_af *ia)
{
- thread_cancel(&ia->hello_timer);
+ THREAD_OFF(ia->hello_timer);
}
struct ctl_iface *
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 9d1daabbe..efc07b454 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -417,8 +417,8 @@ static void lde_dispatch_imsg(struct thread *thread)
imsg_event_add(iev);
else {
/* this pipe is dead, so remove the event handlers and exit */
- thread_cancel(&iev->ev_read);
- thread_cancel(&iev->ev_write);
+ THREAD_OFF(iev->ev_read);
+ THREAD_OFF(iev->ev_write);
lde_shutdown();
}
}
@@ -702,8 +702,8 @@ static void lde_dispatch_parent(struct thread *thread)
imsg_event_add(iev);
else {
/* this pipe is dead, so remove the event handlers and exit */
- thread_cancel(&iev->ev_read);
- thread_cancel(&iev->ev_write);
+ THREAD_OFF(iev->ev_read);
+ THREAD_OFF(iev->ev_write);
lde_shutdown();
}
}
diff --git a/ldpd/lde_lib.c b/ldpd/lde_lib.c
index 1ade3c537..436656054 100644
--- a/ldpd/lde_lib.c
+++ b/ldpd/lde_lib.c
@@ -1068,7 +1068,7 @@ void lde_gc_timer(struct thread *thread)
void
lde_gc_start_timer(void)
{
- thread_cancel(&gc_timer);
+ THREAD_OFF(gc_timer);
thread_add_timer(master, lde_gc_timer, NULL, LDE_GC_INTERVAL,
&gc_timer);
}
@@ -1076,5 +1076,5 @@ lde_gc_start_timer(void)
void
lde_gc_stop_timer(void)
{
- thread_cancel(&gc_timer);
+ THREAD_OFF(gc_timer);
}
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index 796cf1179..87d78afa2 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -616,8 +616,8 @@ static void main_dispatch_ldpe(struct thread *thread)
imsg_event_add(iev);
else {
/* this pipe is dead, so remove the event handlers and exit */
- thread_cancel(&iev->ev_read);
- thread_cancel(&iev->ev_write);
+ THREAD_OFF(iev->ev_read);
+ THREAD_OFF(iev->ev_write);
ldpe_pid = 0;
if (lde_pid == 0)
ldpd_shutdown();
@@ -721,8 +721,8 @@ static void main_dispatch_lde(struct thread *thread)
imsg_event_add(iev);
else {
/* this pipe is dead, so remove the event handlers and exit */
- thread_cancel(&iev->ev_read);
- thread_cancel(&iev->ev_write);
+ THREAD_OFF(iev->ev_read);
+ THREAD_OFF(iev->ev_write);
lde_pid = 0;
if (ldpe_pid == 0)
ldpd_shutdown();
@@ -744,8 +744,8 @@ void ldp_write_handler(struct thread *thread)
fatal("msgbuf_write");
if (n == 0) {
/* this pipe is dead, so remove the event handlers */
- thread_cancel(&iev->ev_read);
- thread_cancel(&iev->ev_write);
+ THREAD_OFF(iev->ev_read);
+ THREAD_OFF(iev->ev_write);
return;
}
@@ -829,7 +829,7 @@ void evbuf_init(struct evbuf *eb, int fd, void (*handler)(struct thread *),
void
evbuf_clear(struct evbuf *eb)
{
- thread_cancel(&eb->ev);
+ THREAD_OFF(eb->ev);
msgbuf_clear(&eb->wbuf);
eb->wbuf.fd = -1;
}
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c
index 29abd420e..792dcb2f2 100644
--- a/ldpd/ldpe.c
+++ b/ldpd/ldpe.c
@@ -212,7 +212,7 @@ ldpe_shutdown(void)
#ifdef __OpenBSD__
if (sysdep.no_pfkey == 0) {
- thread_cancel(&pfkey_ev);
+ THREAD_OFF(pfkey_ev);
close(global.pfkeysock);
}
#endif
@@ -626,8 +626,8 @@ static void ldpe_dispatch_main(struct thread *thread)
imsg_event_add(iev);
else {
/* this pipe is dead, so remove the event handlers and exit */
- thread_cancel(&iev->ev_read);
- thread_cancel(&iev->ev_write);
+ THREAD_OFF(iev->ev_read);
+ THREAD_OFF(iev->ev_write);
ldpe_shutdown();
}
}
@@ -762,8 +762,8 @@ static void ldpe_dispatch_lde(struct thread *thread)
imsg_event_add(iev);
else {
/* this pipe is dead, so remove the event handlers and exit */
- thread_cancel(&iev->ev_read);
- thread_cancel(&iev->ev_write);
+ THREAD_OFF(iev->ev_read);
+ THREAD_OFF(iev->ev_write);
ldpe_shutdown();
}
}
@@ -813,14 +813,14 @@ ldpe_close_sockets(int af)
af_global = ldp_af_global_get(&global, af);
/* discovery socket */
- thread_cancel(&af_global->disc_ev);
+ THREAD_OFF(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_cancel(&af_global->edisc_ev);
+ THREAD_OFF(af_global->edisc_ev);
if (af_global->ldp_edisc_socket != -1) {
close(af_global->ldp_edisc_socket);
af_global->ldp_edisc_socket = -1;
diff --git a/ldpd/neighbor.c b/ldpd/neighbor.c
index 514bcee32..e1db9e8e1 100644
--- a/ldpd/neighbor.c
+++ b/ldpd/neighbor.c
@@ -307,7 +307,7 @@ nbr_del(struct nbr *nbr)
nbr->auth.method = AUTH_NONE;
if (nbr_pending_connect(nbr))
- thread_cancel(&nbr->ev_connect);
+ THREAD_OFF(nbr->ev_connect);
nbr_stop_ktimer(nbr);
nbr_stop_ktimeout(nbr);
nbr_stop_itimeout(nbr);
@@ -435,7 +435,7 @@ nbr_start_ktimer(struct nbr *nbr)
/* send three keepalives per period */
secs = nbr->keepalive / KEEPALIVE_PER_PERIOD;
- thread_cancel(&nbr->keepalive_timer);
+ THREAD_OFF(nbr->keepalive_timer);
nbr->keepalive_timer = NULL;
thread_add_timer(master, nbr_ktimer, nbr, secs, &nbr->keepalive_timer);
}
@@ -443,7 +443,7 @@ nbr_start_ktimer(struct nbr *nbr)
void
nbr_stop_ktimer(struct nbr *nbr)
{
- thread_cancel(&nbr->keepalive_timer);
+ THREAD_OFF(nbr->keepalive_timer);
}
/* Keepalive timeout: if the nbr hasn't sent keepalive */
@@ -462,7 +462,7 @@ static void nbr_ktimeout(struct thread *thread)
static void
nbr_start_ktimeout(struct nbr *nbr)
{
- thread_cancel(&nbr->keepalive_timeout);
+ THREAD_OFF(nbr->keepalive_timeout);
nbr->keepalive_timeout = NULL;
thread_add_timer(master, nbr_ktimeout, nbr, nbr->keepalive,
&nbr->keepalive_timeout);
@@ -471,7 +471,7 @@ nbr_start_ktimeout(struct nbr *nbr)
void
nbr_stop_ktimeout(struct nbr *nbr)
{
- thread_cancel(&nbr->keepalive_timeout);
+ THREAD_OFF(nbr->keepalive_timeout);
}
/* Session initialization timeout: if nbr got stuck in the initialization FSM */
@@ -491,7 +491,7 @@ nbr_start_itimeout(struct nbr *nbr)
int secs;
secs = INIT_FSM_TIMEOUT;
- thread_cancel(&nbr->init_timeout);
+ THREAD_OFF(nbr->init_timeout);
nbr->init_timeout = NULL;
thread_add_timer(master, nbr_itimeout, nbr, secs, &nbr->init_timeout);
}
@@ -499,7 +499,7 @@ nbr_start_itimeout(struct nbr *nbr)
void
nbr_stop_itimeout(struct nbr *nbr)
{
- thread_cancel(&nbr->init_timeout);
+ THREAD_OFF(nbr->init_timeout);
}
/* Init delay timer: timer to retry to iniziatize session */
@@ -537,7 +537,7 @@ nbr_start_idtimer(struct nbr *nbr)
break;
}
- thread_cancel(&nbr->initdelay_timer);
+ THREAD_OFF(nbr->initdelay_timer);
nbr->initdelay_timer = NULL;
thread_add_timer(master, nbr_idtimer, nbr, secs,
&nbr->initdelay_timer);
@@ -546,7 +546,7 @@ nbr_start_idtimer(struct nbr *nbr)
void
nbr_stop_idtimer(struct nbr *nbr)
{
- thread_cancel(&nbr->initdelay_timer);
+ THREAD_OFF(nbr->initdelay_timer);
}
int
diff --git a/ldpd/packet.c b/ldpd/packet.c
index 707878ca9..2cca52461 100644
--- a/ldpd/packet.c
+++ b/ldpd/packet.c
@@ -651,7 +651,7 @@ session_shutdown(struct nbr *nbr, uint32_t status, uint32_t msg_id,
switch (nbr->state) {
case NBR_STA_PRESENT:
if (nbr_pending_connect(nbr))
- thread_cancel(&nbr->ev_connect);
+ THREAD_OFF(nbr->ev_connect);
break;
case NBR_STA_INITIAL:
case NBR_STA_OPENREC:
@@ -756,7 +756,7 @@ tcp_close(struct tcp_conn *tcp)
evbuf_clear(&tcp->wbuf);
if (tcp->nbr) {
- thread_cancel(&tcp->rev);
+ THREAD_OFF(tcp->rev);
free(tcp->rbuf);
tcp->nbr->tcp = NULL;
}
@@ -788,7 +788,7 @@ pending_conn_new(int fd, int af, union ldpd_addr *addr)
void
pending_conn_del(struct pending_conn *pconn)
{
- thread_cancel(&pconn->ev_timeout);
+ THREAD_OFF(pconn->ev_timeout);
TAILQ_REMOVE(&global.pending_conns, pconn, entry);
free(pconn);
}