diff options
author | mtm <mtm@FreeBSD.org> | 2004-02-18 15:05:56 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2004-02-18 15:05:56 +0000 |
commit | 2621f285155185c0ac7b5fad9ba0ef1c8873ce24 (patch) | |
tree | cd2e10b898446191de9a5b04c01c1b2a5f62e5c7 /lib/libthr/thread/thr_init.c | |
parent | 0ebad2cb98e884d81e502635a4650cbe65a3ffe4 (diff) | |
download | FreeBSD-src-2621f285155185c0ac7b5fad9ba0ef1c8873ce24.zip FreeBSD-src-2621f285155185c0ac7b5fad9ba0ef1c8873ce24.tar.gz |
Move the initialization of thread priority to a common function.
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r-- | lib/libthr/thread/thr_init.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 514ed5c..68532f1 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -180,6 +180,9 @@ init_td_common(struct pthread *td, struct pthread_attr *attrp, int reinit) memcpy(&td->attr, attrp, sizeof(struct pthread_attr)); td->magic = PTHREAD_MAGIC; TAILQ_INIT(&td->mutexq); + td->base_priority = PTHREAD_DEFAULT_PRIORITY; + td->active_priority = PTHREAD_DEFAULT_PRIORITY; + td->inherited_priority = PTHREAD_MIN_PRIORITY; } else { memset(&td->join_status, 0, sizeof(struct join_status)); } @@ -347,11 +350,6 @@ _thread_init(void) pthread->ctx.uc_stack.ss_sp = pthread->stack; pthread->ctx.uc_stack.ss_size = PTHREAD_STACK_INITIAL; - /* Default the priority of the initial thread: */ - pthread->base_priority = PTHREAD_DEFAULT_PRIORITY; - pthread->active_priority = PTHREAD_DEFAULT_PRIORITY; - pthread->inherited_priority = 0; - /* Initialise the state of the initial thread: */ pthread->state = PS_RUNNING; |