diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-05-17 16:29:29 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-05-20 09:52:16 -0400 |
| commit | c905f04c7ce7b09189999d4908c379f880b6b179 (patch) | |
| tree | 28d5769ebac08b41f3410ca7ecc4c7138b15500a /ospf6d/ospf6_spf.c | |
| parent | 23b11ab185878eb77b3212b9673856bc99d960f2 (diff) | |
ospf6d: Clean up thread interface
a) Remove setting of thread pointer to NULL after
thread invocation, this is already done.
b) Use thread_is_scheduled()
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ospf6d/ospf6_spf.c')
| -rw-r--r-- | ospf6d/ospf6_spf.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 2e8e9f2cdd..aac371ebbb 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -615,7 +615,6 @@ static void ospf6_spf_calculation_thread(struct thread *t) char rbuf[32]; ospf6 = (struct ospf6 *)THREAD_ARG(t); - ospf6->t_spf_calc = NULL; /* execute SPF calculation */ monotime(&start); @@ -703,7 +702,7 @@ void ospf6_spf_schedule(struct ospf6 *ospf6, unsigned int reason) } /* SPF calculation timer is already scheduled. */ - if (ospf6->t_spf_calc) { + if (thread_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", @@ -740,7 +739,7 @@ void ospf6_spf_schedule(struct ospf6 *ospf6, unsigned int reason) if (IS_OSPF6_DEBUG_SPF(PROCESS) || IS_OSPF6_DEBUG_SPF(TIME)) zlog_debug("SPF: Rescheduling in %ld msec", delay); - ospf6->t_spf_calc = NULL; + THREAD_OFF(ospf6->t_spf_calc); thread_add_timer_msec(master, ospf6_spf_calculation_thread, ospf6, delay, &ospf6->t_spf_calc); } @@ -1253,7 +1252,6 @@ static void ospf6_ase_calculate_timer(struct thread *t) uint16_t type; ospf6 = THREAD_ARG(t); - ospf6->t_ase_calc = NULL; /* Calculate external route for each AS-external-LSA */ type = htons(OSPF6_LSTYPE_AS_EXTERNAL); |
