summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1998-12-21 07:41:32 +0000
committerDavid Leonard <d@cvs.openbsd.org>1998-12-21 07:41:32 +0000
commit3bd93c4b0488a562ddd434f4679e19331948ec3a (patch)
treeb3b455b03de2fedb99cf073dc36652e25d81d9a4 /lib/libc_r/uthread
parent447e300b19ab34eecb05ea8f02915e0de86ad626 (diff)
resource accounting
Diffstat (limited to 'lib/libc_r/uthread')
-rw-r--r--lib/libc_r/uthread/pthread_private.h6
-rw-r--r--lib/libc_r/uthread/uthread_create.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index 96d53c36d4e..d562003026a 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -383,6 +383,12 @@ struct pthread {
long slice_usec;
/*
+ * Cumulative times spent in thread
+ */
+ struct timeval ru_utime;
+ struct timeval ru_stime;
+
+ /*
* Incremental priority accumulated by thread while it is ready to
* run but is denied being run.
*/
diff --git a/lib/libc_r/uthread/uthread_create.c b/lib/libc_r/uthread/uthread_create.c
index ce70db0b3d4..4ce34434f3e 100644
--- a/lib/libc_r/uthread/uthread_create.c
+++ b/lib/libc_r/uthread/uthread_create.c
@@ -88,6 +88,8 @@ pthread_create(pthread_t * thread, const pthread_attr_t * attr,
new_thread->stack = stack;
new_thread->start_routine = start_routine;
new_thread->arg = arg;
+ timerclear(&new_thread->ru_utime);
+ timerclear(&new_thread->ru_stime);
/*
* Write a magic value to the thread structure