From e7d9e44b0237a3d1e952f79c1bd1d143a15e2414 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Thu, 18 Feb 2021 09:38:19 -0500 Subject: [PATCH] lib: pass the thread_master to process_timers() Pass the thread_master pointer to process_timers() as we do for other list-processing apis. Signed-off-by: Mark Stapp --- lib/thread.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/thread.c b/lib/thread.c index 47f0fdfb7e..f7f1ed8b7e 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -1452,20 +1452,21 @@ static void thread_process_io(struct thread_master *m, unsigned int num) } /* Add all timers that have popped to the ready list. */ -static unsigned int thread_process_timers(struct thread_timer_list_head *timers, +static unsigned int thread_process_timers(struct thread_master *m, struct timeval *timenow) { struct thread *thread; unsigned int ready = 0; - while ((thread = thread_timer_list_first(timers))) { + while ((thread = thread_timer_list_first(&m->timer))) { if (timercmp(timenow, &thread->u.sands, <)) - return ready; - thread_timer_list_pop(timers); + break; + thread_timer_list_pop(&m->timer); thread->type = THREAD_READY; - thread_list_add_tail(&thread->master->ready, thread); + thread_list_add_tail(&m->ready, thread); ready++; } + return ready; } @@ -1587,7 +1588,7 @@ struct thread *thread_fetch(struct thread_master *m, struct thread *fetch) /* Post timers to ready queue. */ monotime(&now); - thread_process_timers(&m->timer, &now); + thread_process_timers(m, &now); /* Post I/O to ready queue. */ if (num > 0) -- 2.39.5