Move the initialization of thread priority to a common function.

This commit is contained in:
Mike Makonnen 2004-02-18 15:05:56 +00:00
parent 0d48409fe2
commit 06e5becb69
2 changed files with 3 additions and 6 deletions

View File

@ -139,7 +139,6 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
new_thread->base_priority = new_thread->attr.prio;
}
new_thread->active_priority = new_thread->base_priority;
new_thread->inherited_priority = 0;
/*
* Initialise the unique id which GDB uses to

View File

@ -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;