]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Convert a bunch of thread_XX to event_XX
authorDonald Sharp <sharpd@nvidia.com>
Sun, 11 Dec 2022 15:51:58 +0000 (10:51 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 24 Mar 2023 12:32:17 +0000 (08:32 -0400)
Convert these functions:

thread_getrusage
thread_cmd_init
thread_consumed_time
thread_timer_to_hhmmss
thread_is_scheduled
thread_ignore_late_timer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 files changed:
bgpd/bgp_conditional_adv.c
bgpd/bgp_vty.c
isisd/isis_lsp.c
isisd/isis_main.c
lib/command.c
lib/event.c
lib/event.h
lib/vty.c
lib/workqueue.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_nssa.c
ospf6d/ospf6_spf.c
ospf6d/ospf6_top.c
zebra/interface.c
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_mh.c
zebra/zebra_evpn_neigh.c
zebra/zebra_nhg.c
zebra/zebra_rib.c
zebra/zebra_vty.c

index 32ff4bf2e496d8b19fc068582f58ef424cece2e4..0510ded2e9faf2d2a38dededace3f54f372c8a3c 100644 (file)
@@ -328,7 +328,7 @@ void bgp_conditional_adv_enable(struct peer *peer, afi_t afi, safi_t safi)
        }
 
        /* Register for conditional routes polling timer */
-       if (!thread_is_scheduled(bgp->t_condition_check))
+       if (!event_is_scheduled(bgp->t_condition_check))
                event_add_timer(bm->master, bgp_conditional_adv_timer, bgp, 0,
                                &bgp->t_condition_check);
 }
index bc0681df781909a83588756fcb5f0383fe944b98..c412e24423699cd42dda433f0c7b84234a821ebc 100644 (file)
@@ -13460,7 +13460,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                        json_neigh,
                        "bgpTimerConfiguredConditionalAdvertisementsSec",
                        bgp->condition_check_period);
-               if (thread_is_scheduled(bgp->t_condition_check))
+               if (event_is_scheduled(bgp->t_condition_check))
                        json_object_int_add(
                                json_neigh,
                                "bgpTimerUntilConditionalAdvertisementsSec",
@@ -13541,7 +13541,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                vty_out(vty,
                        "  Configured conditional advertisements interval is %d seconds\n",
                        bgp->condition_check_period);
-               if (thread_is_scheduled(bgp->t_condition_check))
+               if (event_is_scheduled(bgp->t_condition_check))
                        vty_out(vty,
                                "  Time until conditional advertisements begin is %lu seconds\n",
                                event_timer_remain_second(
@@ -18768,7 +18768,7 @@ static struct event *t_bgp_cfg;
 
 bool bgp_config_inprocess(void)
 {
-       return thread_is_scheduled(t_bgp_cfg);
+       return event_is_scheduled(t_bgp_cfg);
 }
 
 static void bgp_config_finish(struct event *t)
@@ -18797,7 +18797,7 @@ static void bgp_config_end(void)
 {
 #define BGP_POST_CONFIG_DELAY_SECONDS 1
        uint32_t bgp_post_config_delay =
-               thread_is_scheduled(bm->t_rmap_update)
+               event_is_scheduled(bm->t_rmap_update)
                        ? event_timer_remain_second(bm->t_rmap_update)
                        : BGP_POST_CONFIG_DELAY_SECONDS;
 
index 114a499ddbbc603f3f347a3692a5551ba89adfe3..1635d66c3950afdad08f609376e90259e2a3cdb9 100644 (file)
@@ -1372,7 +1372,7 @@ int lsp_generate(struct isis_area *area, int level)
                return ISIS_ERROR;
 
        /* Check if config is still being processed */
-       if (thread_is_scheduled(t_isis_cfg))
+       if (event_is_scheduled(t_isis_cfg))
                return ISIS_OK;
 
        memset(&lspid, 0, ISIS_SYS_ID_LEN + 2);
index 363543f5dc7bbf38011b459cdf0e47f9089ece09..04056636a9908836fe59b59a8a0e6c26a198c420 100644 (file)
@@ -195,7 +195,7 @@ static void isis_config_end(void)
        /* If ISIS config processing thread isn't running, then
         * we can return and rely it's properly handled.
         */
-       if (!thread_is_scheduled(t_isis_cfg))
+       if (!event_is_scheduled(t_isis_cfg))
                return;
 
        THREAD_OFF(t_isis_cfg);
index e2de6f322bd810280d70c2b2f9d10b535c5f3a64..be766f7cd170c015fd05d07c2d41cab57d325f30 100644 (file)
@@ -2542,7 +2542,7 @@ void cmd_init(int terminal)
 
                install_default(CONFIG_NODE);
 
-               thread_cmd_init();
+               event_cmd_init();
                workqueue_cmd_init();
                hash_cmd_init();
        }
index 59f8928d1b2a1033ffee3d735d4ba5097aac4440..f5f9c95401c33c3fa3e98689a2b527b96acfaf92 100644 (file)
@@ -516,7 +516,7 @@ DEFPY_NOSH (show_thread_timers,
        return CMD_SUCCESS;
 }
 
-void thread_cmd_init(void)
+void event_cmd_init(void)
 {
        install_element(VIEW_NODE, &show_thread_cpu_cmd);
        install_element(VIEW_NODE, &show_thread_poll_cmd);
@@ -737,7 +737,7 @@ unsigned long event_timer_remain_msec(struct event *thread)
 {
        int64_t remain;
 
-       if (!thread_is_scheduled(thread))
+       if (!event_is_scheduled(thread))
                return 0;
 
        frr_with_mutex (&thread->mtx) {
@@ -780,7 +780,7 @@ static int time_hhmmss(char *buf, int buf_size, long sec)
        return wr != 8;
 }
 
-char *thread_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
+char *event_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
 {
        if (t_timer) {
                time_hhmmss(buf, buf_size, event_timer_remain_second(t_timer));
@@ -1865,8 +1865,8 @@ static unsigned long timeval_elapsed(struct timeval a, struct timeval b)
                + (a.tv_usec - b.tv_usec));
 }
 
-unsigned long thread_consumed_time(RUSAGE_T *now, RUSAGE_T *start,
-                                  unsigned long *cputime)
+unsigned long event_consumed_time(RUSAGE_T *now, RUSAGE_T *start,
+                                 unsigned long *cputime)
 {
 #ifdef HAVE_CLOCK_THREAD_CPUTIME_ID
 
@@ -1927,7 +1927,7 @@ void event_set_yield_time(struct event *thread, unsigned long yield_time)
        }
 }
 
-void thread_getrusage(RUSAGE_T *r)
+void event_getrusage(RUSAGE_T *r)
 {
        monotime(&r->real);
        if (!cputime_enabled) {
@@ -1993,7 +1993,7 @@ void event_call(struct event *thread)
        unsigned long walltime, cputime;
        unsigned long exp;
 
-       walltime = thread_consumed_time(&after, &before, &cputime);
+       walltime = event_consumed_time(&after, &before, &cputime);
 
        /* update walltime */
        atomic_fetch_add_explicit(&thread->hist->real.total, walltime,
index 03d7d6d192c82b1d739b9019599e20ea6c834546..dcc7cee5e66fe73fae69792351f986e887874324 100644 (file)
@@ -35,7 +35,7 @@ struct rusage_t {
 };
 #define RUSAGE_T        struct rusage_t
 
-#define GETRUSAGE(X) thread_getrusage(X)
+#define GETRUSAGE(X) event_getrusage(X)
 
 PREDECL_LIST(thread_list);
 PREDECL_HEAP(thread_timer_list);
@@ -259,19 +259,19 @@ extern int event_should_yield(struct event *event);
 extern void event_set_yield_time(struct event *event, unsigned long);
 
 /* Internal libfrr exports */
-extern void thread_getrusage(RUSAGE_T *);
-extern void thread_cmd_init(void);
+extern void event_getrusage(RUSAGE_T *);
+extern void event_cmd_init(void);
 
 /* Returns elapsed real (wall clock) time. */
-extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
-                                         unsigned long *cpu_time_elapsed);
+extern unsigned long event_consumed_time(RUSAGE_T *after, RUSAGE_T *before,
+                                        unsigned long *cpu_time_elapsed);
 
 /* only for use in logging functions! */
 extern pthread_key_t thread_current;
-extern char *thread_timer_to_hhmmss(char *buf, int buf_size,
-                                   struct event *t_timer);
+extern char *event_timer_to_hhmmss(char *buf, int buf_size,
+                                  struct event *t_timer);
 
-static inline bool thread_is_scheduled(struct event *thread)
+static inline bool event_is_scheduled(struct event *thread)
 {
        if (thread)
                return true;
@@ -282,7 +282,7 @@ static inline bool thread_is_scheduled(struct event *thread)
 /* Debug signal mask */
 void debug_signals(const sigset_t *sigs);
 
-static inline void thread_ignore_late_timer(struct event *event)
+static inline void event_ignore_late_timer(struct event *event)
 {
        event->ignore_timer_late = true;
 }
index 8324878c2870a3f17f7fb0bb1b3404a4ca613b72..464bd11ea08b44b2684d05c739dca3bb2d016983 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -545,7 +545,7 @@ static int vty_command(struct vty *vty, char *buf)
 
        GETRUSAGE(&after);
 
-       walltime = thread_consumed_time(&after, &before, &cputime);
+       walltime = event_consumed_time(&after, &before, &cputime);
 
        if (cputime_enabled_here && cputime_enabled && cputime_threshold
            && cputime > cputime_threshold)
index 7660663449a655f09e144c7208a6424a092cd06f..cba611cd153a2c2757e0f079554fa151ec22e17f 100644 (file)
@@ -106,27 +106,27 @@ void work_queue_free_and_null(struct work_queue **wqp)
 
 bool work_queue_is_scheduled(struct work_queue *wq)
 {
-       return thread_is_scheduled(wq->thread);
+       return event_is_scheduled(wq->thread);
 }
 
 static int work_queue_schedule(struct work_queue *wq, unsigned int delay)
 {
        /* if appropriate, schedule work queue thread */
        if (CHECK_FLAG(wq->flags, WQ_UNPLUGGED) &&
-           !thread_is_scheduled(wq->thread) && !work_queue_empty(wq)) {
+           !event_is_scheduled(wq->thread) && !work_queue_empty(wq)) {
                /* Schedule timer if there's a delay, otherwise just schedule
                 * as an 'event'
                 */
                if (delay > 0) {
                        event_add_timer_msec(wq->master, work_queue_run, wq,
                                             delay, &wq->thread);
-                       thread_ignore_late_timer(wq->thread);
+                       event_ignore_late_timer(wq->thread);
                } else
                        event_add_event(wq->master, work_queue_run, wq, 0,
                                        &wq->thread);
 
                /* set thread yield time, if needed */
-               if (thread_is_scheduled(wq->thread) &&
+               if (event_is_scheduled(wq->thread) &&
                    wq->spec.yield != EVENT_YIELD_TIME_SLOT)
                        event_set_yield_time(wq->thread, wq->spec.yield);
                return 1;
index bb47b66755462cadc3c890b504b3e430051cec42..81b393f20d0cd144d838028d7602859ad892cf98 100644 (file)
@@ -1104,7 +1104,7 @@ void ospf6_asbr_distribute_list_update(struct ospf6 *ospf6,
 {
        SET_FLAG(red->flag, OSPF6_IS_RMAP_CHANGED);
 
-       if (thread_is_scheduled(ospf6->t_distribute_update))
+       if (event_is_scheduled(ospf6->t_distribute_update))
                return;
 
        if (IS_OSPF6_DEBUG_ASBR)
@@ -3363,7 +3363,7 @@ ospf6_start_asbr_summary_delay_timer(struct ospf6 *ospf6,
 {
        aggr->action = operation;
 
-       if (thread_is_scheduled(ospf6->t_external_aggr)) {
+       if (event_is_scheduled(ospf6->t_external_aggr)) {
                if (ospf6->aggr_action == OSPF6_ROUTE_AGGR_ADD) {
 
                        if (IS_OSPF6_DEBUG_AGGR)
index 2c8d168e09634e4d6309578c9d83be4f571795d5..f195b171036bc27162b6dd8ea933189e30006e0a 100644 (file)
@@ -1140,7 +1140,7 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
 
        if (use_json) {
                timerclear(&res);
-               if (thread_is_scheduled(oi->thread_send_lsupdate))
+               if (event_is_scheduled(oi->thread_send_lsupdate))
                        timersub(&oi->thread_send_lsupdate->u.sands, &now,
                                 &res);
                timerstring(&res, duration, sizeof(duration));
@@ -1150,9 +1150,8 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
                                       duration);
                json_object_string_add(
                        json_obj, "lsUpdateSendThread",
-                       (thread_is_scheduled(oi->thread_send_lsupdate)
-                                ? "on"
-                                : "off"));
+                       (event_is_scheduled(oi->thread_send_lsupdate) ? "on"
+                                                                     : "off"));
 
                json_arr = json_object_new_array();
                for (ALL_LSDB(oi->lsupdate_list, lsa, lsanext))
@@ -1162,7 +1161,7 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
                                       json_arr);
 
                timerclear(&res);
-               if (thread_is_scheduled(oi->thread_send_lsack))
+               if (event_is_scheduled(oi->thread_send_lsack))
                        timersub(&oi->thread_send_lsack->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
 
@@ -1172,8 +1171,8 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
                                       duration);
                json_object_string_add(
                        json_obj, "lsAckSendThread",
-                       (thread_is_scheduled(oi->thread_send_lsack) ? "on"
-                                                                   : "off"));
+                       (event_is_scheduled(oi->thread_send_lsack) ? "on"
+                                                                  : "off"));
 
                json_arr = json_object_new_array();
                for (ALL_LSDB(oi->lsack_list, lsa, lsanext))
@@ -1183,28 +1182,27 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
 
        } else {
                timerclear(&res);
-               if (thread_is_scheduled(oi->thread_send_lsupdate))
+               if (event_is_scheduled(oi->thread_send_lsupdate))
                        timersub(&oi->thread_send_lsupdate->u.sands, &now,
                                 &res);
                timerstring(&res, duration, sizeof(duration));
                vty_out(vty,
                        "    %d Pending LSAs for LSUpdate in Time %s [thread %s]\n",
                        oi->lsupdate_list->count, duration,
-                       (thread_is_scheduled(oi->thread_send_lsupdate)
-                                ? "on"
-                                : "off"));
+                       (event_is_scheduled(oi->thread_send_lsupdate) ? "on"
+                                                                     : "off"));
                for (ALL_LSDB(oi->lsupdate_list, lsa, lsanext))
                        vty_out(vty, "      %s\n", lsa->name);
 
                timerclear(&res);
-               if (thread_is_scheduled(oi->thread_send_lsack))
+               if (event_is_scheduled(oi->thread_send_lsack))
                        timersub(&oi->thread_send_lsack->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
                vty_out(vty,
                        "    %d Pending LSAs for LSAck in Time %s [thread %s]\n",
                        oi->lsack_list->count, duration,
-                       (thread_is_scheduled(oi->thread_send_lsack) ? "on"
-                                                                   : "off"));
+                       (event_is_scheduled(oi->thread_send_lsack) ? "on"
+                                                                  : "off"));
                for (ALL_LSDB(oi->lsack_list, lsa, lsanext))
                        vty_out(vty, "      %s\n", lsa->name);
        }
@@ -2107,7 +2105,7 @@ DEFUN (ipv6_ospf6_hellointerval,
        /*
         * If the thread is scheduled, send the new hello now.
         */
-       if (thread_is_scheduled(oi->thread_send_hello)) {
+       if (event_is_scheduled(oi->thread_send_hello)) {
                THREAD_OFF(oi->thread_send_hello);
 
                event_add_timer(master, ospf6_hello_send, oi, 0,
index aaa23659eb95e94443552a18bb17b5031d4d151c..5af69738c0149679b05d290a0f4fab97613a339b 100644 (file)
@@ -815,7 +815,7 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
 
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_dbdesc))
+               if (event_is_scheduled(on->thread_send_dbdesc))
                        timersub(&on->thread_send_dbdesc->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
                json_object_int_add(json_neighbor, "pendingLsaDbDescCount",
@@ -824,8 +824,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
                                       duration);
                json_object_string_add(
                        json_neighbor, "dbDescSendThread",
-                       (thread_is_scheduled(on->thread_send_dbdesc) ? "on"
-                                                                    : "off"));
+                       (event_is_scheduled(on->thread_send_dbdesc) ? "on"
+                                                                   : "off"));
                json_array = json_object_new_array();
                for (ALL_LSDB(on->dbdesc_list, lsa, lsanext))
                        json_object_array_add(
@@ -834,7 +834,7 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
                                       json_array);
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_lsreq))
+               if (event_is_scheduled(on->thread_send_lsreq))
                        timersub(&on->thread_send_lsreq->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
                json_object_int_add(json_neighbor, "pendingLsaLsReqCount",
@@ -843,8 +843,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
                                       duration);
                json_object_string_add(
                        json_neighbor, "lsReqSendThread",
-                       (thread_is_scheduled(on->thread_send_lsreq) ? "on"
-                                                                   : "off"));
+                       (event_is_scheduled(on->thread_send_lsreq) ? "on"
+                                                                  : "off"));
                json_array = json_object_new_array();
                for (ALL_LSDB(on->request_list, lsa, lsanext))
                        json_object_array_add(
@@ -854,7 +854,7 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
 
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_lsupdate))
+               if (event_is_scheduled(on->thread_send_lsupdate))
                        timersub(&on->thread_send_lsupdate->u.sands, &now,
                                 &res);
                timerstring(&res, duration, sizeof(duration));
@@ -864,9 +864,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
                                       duration);
                json_object_string_add(
                        json_neighbor, "lsUpdateSendThread",
-                       (thread_is_scheduled(on->thread_send_lsupdate)
-                                ? "on"
-                                : "off"));
+                       (event_is_scheduled(on->thread_send_lsupdate) ? "on"
+                                                                     : "off"));
                json_array = json_object_new_array();
                for (ALL_LSDB(on->lsupdate_list, lsa, lsanext))
                        json_object_array_add(
@@ -875,7 +874,7 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
                                       json_array);
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_lsack))
+               if (event_is_scheduled(on->thread_send_lsack))
                        timersub(&on->thread_send_lsack->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
                json_object_int_add(json_neighbor, "pendingLsaLsAckCount",
@@ -884,8 +883,8 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
                                       duration);
                json_object_string_add(
                        json_neighbor, "lsAckSendThread",
-                       (thread_is_scheduled(on->thread_send_lsack) ? "on"
-                                                                   : "off"));
+                       (event_is_scheduled(on->thread_send_lsack) ? "on"
+                                                                  : "off"));
                json_array = json_object_new_array();
                for (ALL_LSDB(on->lsack_list, lsa, lsanext))
                        json_object_array_add(
@@ -973,52 +972,51 @@ static void ospf6_neighbor_show_detail(struct vty *vty,
                        vty_out(vty, "      %s\n", lsa->name);
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_dbdesc))
+               if (event_is_scheduled(on->thread_send_dbdesc))
                        timersub(&on->thread_send_dbdesc->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
                vty_out(vty,
                        "    %d Pending LSAs for DbDesc in Time %s [thread %s]\n",
                        on->dbdesc_list->count, duration,
-                       (thread_is_scheduled(on->thread_send_dbdesc) ? "on"
-                                                                    : "off"));
+                       (event_is_scheduled(on->thread_send_dbdesc) ? "on"
+                                                                   : "off"));
                for (ALL_LSDB(on->dbdesc_list, lsa, lsanext))
                        vty_out(vty, "      %s\n", lsa->name);
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_lsreq))
+               if (event_is_scheduled(on->thread_send_lsreq))
                        timersub(&on->thread_send_lsreq->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
                vty_out(vty,
                        "    %d Pending LSAs for LSReq in Time %s [thread %s]\n",
                        on->request_list->count, duration,
-                       (thread_is_scheduled(on->thread_send_lsreq) ? "on"
-                                                                   : "off"));
+                       (event_is_scheduled(on->thread_send_lsreq) ? "on"
+                                                                  : "off"));
                for (ALL_LSDB(on->request_list, lsa, lsanext))
                        vty_out(vty, "      %s\n", lsa->name);
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_lsupdate))
+               if (event_is_scheduled(on->thread_send_lsupdate))
                        timersub(&on->thread_send_lsupdate->u.sands, &now,
                                 &res);
                timerstring(&res, duration, sizeof(duration));
                vty_out(vty,
                        "    %d Pending LSAs for LSUpdate in Time %s [thread %s]\n",
                        on->lsupdate_list->count, duration,
-                       (thread_is_scheduled(on->thread_send_lsupdate)
-                                ? "on"
-                                : "off"));
+                       (event_is_scheduled(on->thread_send_lsupdate) ? "on"
+                                                                     : "off"));
                for (ALL_LSDB(on->lsupdate_list, lsa, lsanext))
                        vty_out(vty, "      %s\n", lsa->name);
 
                timerclear(&res);
-               if (thread_is_scheduled(on->thread_send_lsack))
+               if (event_is_scheduled(on->thread_send_lsack))
                        timersub(&on->thread_send_lsack->u.sands, &now, &res);
                timerstring(&res, duration, sizeof(duration));
                vty_out(vty,
                        "    %d Pending LSAs for LSAck in Time %s [thread %s]\n",
                        on->lsack_list->count, duration,
-                       (thread_is_scheduled(on->thread_send_lsack) ? "on"
-                                                                   : "off"));
+                       (event_is_scheduled(on->thread_send_lsack) ? "on"
+                                                                  : "off"));
                for (ALL_LSDB(on->lsack_list, lsa, lsanext))
                        vty_out(vty, "      %s\n", lsa->name);
 
index 87754a59a8e0625935fd6c1a430aeb63c4556abe..15fcab13f765816dcb320aaad5c9a9e444883a63 100644 (file)
@@ -992,7 +992,7 @@ static void ospf6_abr_task_timer(struct event *thread)
 
 void ospf6_schedule_abr_task(struct ospf6 *ospf6)
 {
-       if (thread_is_scheduled(ospf6->t_abr_task)) {
+       if (event_is_scheduled(ospf6->t_abr_task)) {
                if (IS_OSPF6_DEBUG_ABR)
                        zlog_debug("ABR task already scheduled");
                return;
index 051fd83f6d6e4af60b64d64bf17adfd55577cff0..b8d5bfef6f47c1191e2502e6c14ae615e840aaf5 100644 (file)
@@ -687,7 +687,7 @@ void ospf6_spf_schedule(struct ospf6 *ospf6, unsigned int reason)
        }
 
        /* SPF calculation timer is already scheduled. */
-       if (thread_is_scheduled(ospf6->t_spf_calc)) {
+       if (event_is_scheduled(ospf6->t_spf_calc)) {
                if (IS_OSPF6_DEBUG_SPF(PROCESS) || IS_OSPF6_DEBUG_SPF(TIME))
                        zlog_debug(
                                "SPF: calculation timer is already scheduled: %p",
index db45198acd3040869788ade4c95560599f23dbe9..58124cabd67dee35446e641c29a6d35fa0260663 100644 (file)
@@ -1359,7 +1359,7 @@ static void ospf6_show(struct vty *vty, struct ospf6 *o, json_object *json,
                } else
                        json_object_boolean_false_add(json, "spfHasRun");
 
-               if (thread_is_scheduled(o->t_spf_calc)) {
+               if (event_is_scheduled(o->t_spf_calc)) {
                        long time_store;
 
                        json_object_boolean_true_add(json, "spfTimerActive");
@@ -1452,8 +1452,7 @@ static void ospf6_show(struct vty *vty, struct ospf6 *o, json_object *json,
 
                threadtimer_string(now, o->t_spf_calc, buf, sizeof(buf));
                vty_out(vty, " SPF timer %s%s\n",
-                       (thread_is_scheduled(o->t_spf_calc) ? "due in "
-                                                           : "is "),
+                       (event_is_scheduled(o->t_spf_calc) ? "due in " : "is "),
                        buf);
 
                if (CHECK_FLAG(o->flag, OSPF6_STUB_ROUTER))
index 8e4d15aa8450e2ee2046fea7c75c55e8713d1c51..9f05a8d117ab0ba32b2c495f5162e63eab12f84a 100644 (file)
@@ -98,7 +98,7 @@ static void if_zebra_speed_update(struct event *thread)
                zif->speed_update_count++;
                event_add_timer(zrouter.master, if_zebra_speed_update, ifp,
                                SPEED_UPDATE_SLEEP_TIME, &zif->speed_update);
-               thread_ignore_late_timer(zif->speed_update);
+               event_ignore_late_timer(zif->speed_update);
        }
 }
 
@@ -163,7 +163,7 @@ static int if_zebra_new_hook(struct interface *ifp)
        zebra_if->speed_update_count = 0;
        event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 15,
                        &zebra_if->speed_update);
-       thread_ignore_late_timer(zebra_if->speed_update);
+       event_ignore_late_timer(zebra_if->speed_update);
 
        return 0;
 }
@@ -1040,7 +1040,7 @@ void if_up(struct interface *ifp, bool install_connected)
 
        event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0,
                        &zif->speed_update);
-       thread_ignore_late_timer(zif->speed_update);
+       event_ignore_late_timer(zif->speed_update);
 }
 
 /* Interface goes down.  We have to manage different behavior of based
index c12bfe5bc01b3f3a68d352c86849745d93898895..36470af6e31c61618d795b9f65d6255c9ca28437 100644 (file)
@@ -692,9 +692,9 @@ void zebra_evpn_print_mac(struct zebra_mac *mac, void *ctxt, json_object *json)
                if (mac->hold_timer)
                        json_object_string_add(
                                json_mac, "peerActiveHold",
-                               thread_timer_to_hhmmss(thread_buf,
-                                                      sizeof(thread_buf),
-                                                      mac->hold_timer));
+                               event_timer_to_hhmmss(thread_buf,
+                                                     sizeof(thread_buf),
+                                                     mac->hold_timer));
                if (mac->es)
                        json_object_string_add(json_mac, "esi",
                                        mac->es->esi_str);
@@ -784,9 +784,9 @@ void zebra_evpn_print_mac(struct zebra_mac *mac, void *ctxt, json_object *json)
                        vty_out(vty, " peer-active");
                if (mac->hold_timer)
                        vty_out(vty, " (ht: %s)",
-                               thread_timer_to_hhmmss(thread_buf,
-                                                      sizeof(thread_buf),
-                                                      mac->hold_timer));
+                               event_timer_to_hhmmss(thread_buf,
+                                                     sizeof(thread_buf),
+                                                     mac->hold_timer));
                vty_out(vty, "\n");
                vty_out(vty, " Local Seq: %u Remote Seq: %u\n", mac->loc_seq,
                        mac->rem_seq);
index c5d5046dfc1b8751bfdc9de47991bf1e2aa4c4e4..0e3e3d01fb0776673187c5bd10170da622a50e63 100644 (file)
@@ -3181,9 +3181,9 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty,
                if (es->df_delay_timer)
                        json_object_string_add(
                                json, "dfDelayTimer",
-                               thread_timer_to_hhmmss(thread_buf,
-                                                      sizeof(thread_buf),
-                                                      es->df_delay_timer));
+                               event_timer_to_hhmmss(thread_buf,
+                                                     sizeof(thread_buf),
+                                                     es->df_delay_timer));
                json_object_int_add(json, "nexthopGroup", es->nhg_id);
                if (listcount(es->es_vtep_list)) {
                        json_vteps = json_object_new_array();
@@ -3226,9 +3226,9 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty,
                                                                  : "df");
                if (es->df_delay_timer)
                        vty_out(vty, " DF delay: %s\n",
-                               thread_timer_to_hhmmss(thread_buf,
-                                                      sizeof(thread_buf),
-                                                      es->df_delay_timer));
+                               event_timer_to_hhmmss(thread_buf,
+                                                     sizeof(thread_buf),
+                                                     es->df_delay_timer));
                vty_out(vty, " DF preference: %u\n", es->df_pref);
                vty_out(vty, " Nexthop group: %u\n", es->nhg_id);
                vty_out(vty, " VTEPs:\n");
@@ -3529,8 +3529,8 @@ void zebra_evpn_mh_json(json_object *json)
        json_object_int_add(json, "startupDelay", zmh_info->startup_delay_time);
        json_object_string_add(
                json, "startupDelayTimer",
-               thread_timer_to_hhmmss(thread_buf, sizeof(thread_buf),
-                                      zmh_info->startup_delay_timer));
+               event_timer_to_hhmmss(thread_buf, sizeof(thread_buf),
+                                     zmh_info->startup_delay_timer));
        json_object_int_add(json, "uplinkConfigCount",
                            zmh_info->uplink_cfg_cnt);
        json_object_int_add(json, "uplinkActiveCount",
@@ -3562,8 +3562,8 @@ void zebra_evpn_mh_print(struct vty *vty)
                zmh_info->mac_hold_time, zmh_info->neigh_hold_time);
        vty_out(vty, "  startup-delay: %ds, start-delay-timer: %s\n",
                zmh_info->startup_delay_time,
-               thread_timer_to_hhmmss(thread_buf, sizeof(thread_buf),
-                                      zmh_info->startup_delay_timer));
+               event_timer_to_hhmmss(thread_buf, sizeof(thread_buf),
+                                     zmh_info->startup_delay_timer));
        vty_out(vty, "  uplink-cfg-cnt: %u, uplink-active-cnt: %u\n",
                zmh_info->uplink_cfg_cnt, zmh_info->uplink_oper_up_cnt);
        if (zmh_info->protodown_rc)
index 11ceae4b5d152c88d5bc58912b25e503b36037a1..393ff3baf4684884e8187c85670fb7140e11ff48 100644 (file)
@@ -1746,9 +1746,9 @@ void zebra_evpn_print_neigh(struct zebra_neigh *n, void *ctxt,
                }
                if (n->hold_timer) {
                        vty_out(vty, " (ht: %s)",
-                               thread_timer_to_hhmmss(thread_buf,
-                                                      sizeof(thread_buf),
-                                                      n->hold_timer));
+                               event_timer_to_hhmmss(thread_buf,
+                                                     sizeof(thread_buf),
+                                                     n->hold_timer));
                        sync_info = true;
                }
                if (!sync_info)
@@ -1769,9 +1769,9 @@ void zebra_evpn_print_neigh(struct zebra_neigh *n, void *ctxt,
                if (n->hold_timer)
                        json_object_string_add(
                                json, "peerActiveHold",
-                               thread_timer_to_hhmmss(thread_buf,
-                                                      sizeof(thread_buf),
-                                                      n->hold_timer));
+                               event_timer_to_hhmmss(thread_buf,
+                                                     sizeof(thread_buf),
+                                                     n->hold_timer));
        }
        if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)) {
                if (n->mac->es) {
index 7eed209a1d0d0cd72805e6ebc24c2ee4a6a5c5af..23156d8bf29064bc3d8558145d14a830f9bf3a4d 100644 (file)
@@ -1727,7 +1727,7 @@ void zebra_nhg_increment_ref(struct nhg_hash_entry *nhe)
 
        nhe->refcnt++;
 
-       if (thread_is_scheduled(nhe->timer)) {
+       if (event_is_scheduled(nhe->timer)) {
                THREAD_OFF(nhe->timer);
                nhe->refcnt--;
                UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND);
index 2864b92310faad86be718be03889440cf036f3d2..17e71db4904436c430eb64524227f607a5d9e5f1 100644 (file)
@@ -4415,7 +4415,7 @@ void rib_update(enum rib_update_event event)
 {
        struct rib_update_ctx *ctx;
 
-       if (thread_is_scheduled(t_rib_update_threads[event]))
+       if (event_is_scheduled(t_rib_update_threads[event]))
                return;
 
        ctx = rib_update_ctx_init(0, event);
index 6d6143002999e2c780be2d4ef8c85ca3f4e01057..56e7226424eb0761e1381e57465fceb54f78f9a8 100644 (file)
@@ -1179,12 +1179,12 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,
                json_object_string_add(json, "type",
                                       zebra_route_string(nhe->type));
                json_object_int_add(json, "refCount", nhe->refcnt);
-               if (thread_is_scheduled(nhe->timer))
+               if (event_is_scheduled(nhe->timer))
                        json_object_string_add(
                                json, "timeToDeletion",
-                               thread_timer_to_hhmmss(time_left,
-                                                      sizeof(time_left),
-                                                      nhe->timer));
+                               event_timer_to_hhmmss(time_left,
+                                                     sizeof(time_left),
+                                                     nhe->timer));
                json_object_string_add(json, "uptime", up_str);
                json_object_string_add(json, "vrf",
                                       vrf_id_to_name(nhe->vrf_id));
@@ -1193,11 +1193,11 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,
                vty_out(vty, "ID: %u (%s)\n", nhe->id,
                        zebra_route_string(nhe->type));
                vty_out(vty, "     RefCnt: %u", nhe->refcnt);
-               if (thread_is_scheduled(nhe->timer))
+               if (event_is_scheduled(nhe->timer))
                        vty_out(vty, " Time to Deletion: %s",
-                               thread_timer_to_hhmmss(time_left,
-                                                      sizeof(time_left),
-                                                      nhe->timer));
+                               event_timer_to_hhmmss(time_left,
+                                                     sizeof(time_left),
+                                                     nhe->timer));
                vty_out(vty, "\n");
 
                vty_out(vty, "     Uptime: %s\n", up_str);