diff options
-rw-r--r-- | lib/libc_r/uthread/uthread_init.c | 6 | ||||
-rw-r--r-- | lib/libkse/thread/thr_init.c | 6 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_init.c | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_init.c b/lib/libc_r/uthread/uthread_init.c index 051483f..b6429bb 100644 --- a/lib/libc_r/uthread/uthread_init.c +++ b/lib/libc_r/uthread/uthread_init.c @@ -90,6 +90,7 @@ _thread_init(void) int i; size_t len; int mib[2]; + struct timeval tv; struct clockinfo clockinfo; struct sigaction act; @@ -223,6 +224,11 @@ _thread_init(void) TAILQ_INIT(&(_thread_initial->mutexq)); _thread_initial->priority_mutex_count = 0; + /* Initialize last active time to now: */ + gettimeofday(&tv, NULL); + _thread_initial->last_active.tv_sec = tv.tv_sec; + _thread_initial->last_active.tv_usec = tv.tv_usec; + /* Initialise the rest of the fields: */ _thread_initial->poll_data.nfds = 0; _thread_initial->poll_data.fds = NULL; diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c index 051483f..b6429bb 100644 --- a/lib/libkse/thread/thr_init.c +++ b/lib/libkse/thread/thr_init.c @@ -90,6 +90,7 @@ _thread_init(void) int i; size_t len; int mib[2]; + struct timeval tv; struct clockinfo clockinfo; struct sigaction act; @@ -223,6 +224,11 @@ _thread_init(void) TAILQ_INIT(&(_thread_initial->mutexq)); _thread_initial->priority_mutex_count = 0; + /* Initialize last active time to now: */ + gettimeofday(&tv, NULL); + _thread_initial->last_active.tv_sec = tv.tv_sec; + _thread_initial->last_active.tv_usec = tv.tv_usec; + /* Initialise the rest of the fields: */ _thread_initial->poll_data.nfds = 0; _thread_initial->poll_data.fds = NULL; diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index 051483f..b6429bb 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/thread/thr_init.c @@ -90,6 +90,7 @@ _thread_init(void) int i; size_t len; int mib[2]; + struct timeval tv; struct clockinfo clockinfo; struct sigaction act; @@ -223,6 +224,11 @@ _thread_init(void) TAILQ_INIT(&(_thread_initial->mutexq)); _thread_initial->priority_mutex_count = 0; + /* Initialize last active time to now: */ + gettimeofday(&tv, NULL); + _thread_initial->last_active.tv_sec = tv.tv_sec; + _thread_initial->last_active.tv_usec = tv.tv_usec; + /* Initialise the rest of the fields: */ _thread_initial->poll_data.nfds = 0; _thread_initial->poll_data.fds = NULL; |