From 662c0429b968ea4faefb784662719846b9a0cbe6 Mon Sep 17 00:00:00 2001 From: David Xu Date: Wed, 20 Nov 2002 12:35:59 +0000 Subject: [PATCH] Fix idle timeout bug, use correct current time of day. --- lib/libkse/thread/thr_kern.c | 4 ++-- lib/libpthread/thread/thr_kern.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c index b738a75a82f..892b6475c01 100644 --- a/lib/libkse/thread/thr_kern.c +++ b/lib/libkse/thread/thr_kern.c @@ -465,10 +465,10 @@ void _thread_kern_idle(void) { struct timespec ts; - struct timeval tod, timeout; + struct timeval timeout; for (;;) { - timersub(&_kern_idle_timeout, &tod, &timeout); + timersub(&_kern_idle_timeout, &_sched_tod, &timeout); TIMEVAL_TO_TIMESPEC(&timeout, &ts); __sys_nanosleep(&ts, NULL); } diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index b738a75a82f..892b6475c01 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -465,10 +465,10 @@ void _thread_kern_idle(void) { struct timespec ts; - struct timeval tod, timeout; + struct timeval timeout; for (;;) { - timersub(&_kern_idle_timeout, &tod, &timeout); + timersub(&_kern_idle_timeout, &_sched_tod, &timeout); TIMEVAL_TO_TIMESPEC(&timeout, &ts); __sys_nanosleep(&ts, NULL); }