diff options
| author | Mark Stapp <mjs@voltanet.io> | 2021-02-18 09:38:19 -0500 |
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2021-02-18 09:42:03 -0500 |
| commit | e7d9e44b0237a3d1e952f79c1bd1d143a15e2414 (patch) | |
| tree | 84b72869ecae3bcf7fa61e827bb5a4c31f42c98d /lib/thread.c | |
| parent | 96fe578a643bf78866d34281d4baf59ac9dd840a (diff) | |
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 <mjs@voltanet.io>
Diffstat (limited to 'lib/thread.c')
| -rw-r--r-- | lib/thread.c | 13 |
1 files 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) |
