diff options
author | deischen <deischen@FreeBSD.org> | 2003-07-18 02:46:55 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-07-18 02:46:55 +0000 |
commit | 8c86a69beb11982e649317ffae6803742f1d0bcc (patch) | |
tree | adcaaa6f7105bf1eafccce659645ce0d84dd1754 /lib/libpthread/thread/thr_private.h | |
parent | 875c5215cc8eb12453d2815a29a56842237d4327 (diff) | |
download | FreeBSD-src-8c86a69beb11982e649317ffae6803742f1d0bcc.zip FreeBSD-src-8c86a69beb11982e649317ffae6803742f1d0bcc.tar.gz |
Cleanup thread accounting. Don't reset a threads timeslice
when it blocks; it only gets reset when it yields.
Properly set a thread's default stack guardsize.
Reviewed by: davidxu
Diffstat (limited to 'lib/libpthread/thread/thr_private.h')
-rw-r--r-- | lib/libpthread/thread/thr_private.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index ccd4faf..21026b7 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -888,7 +888,7 @@ do { \ _pq_insert_tail(&(thrd)->kseg->kg_schedq.sq_runq, thrd) #define THR_RUNQ_REMOVE(thrd) \ _pq_remove(&(thrd)->kseg->kg_schedq.sq_runq, thrd) -#define THR_RUNQ_FIRST() \ +#define THR_RUNQ_FIRST(thrd) \ _pq_first(&(thrd)->kseg->kg_schedq.sq_runq) /* @@ -947,6 +947,9 @@ do { \ (void)_kse_critical_enter(); \ KSE_SCHED_LOCK((curthr)->kse, (curthr)->kseg); \ } while (0) +#define THR_UNLOCK_SWITCH(curthr) do { \ + KSE_SCHED_UNLOCK((curthr)->kse, (curthr)->kseg);\ +} while (0) #define THR_CRITICAL_ENTER(thr) (thr)->critical_count++ #define THR_CRITICAL_LEAVE(thr) do { \ @@ -989,7 +992,7 @@ SCLASS struct pthread_attr _pthread_attr_default SCLASS_PRESET({ SCHED_RR, 0, TIMESLICE_USEC, THR_DEFAULT_PRIORITY, THR_CREATE_RUNNING, PTHREAD_CREATE_JOINABLE, NULL, - NULL, NULL, THR_STACK_DEFAULT + NULL, NULL, THR_STACK_DEFAULT, /* guardsize */0 }); /* Default mutex attributes: */ |