Oops, forgot to set the suspended flag for threads that are created

initially suspended.  This was preventing such threads from getting
resumed.

Reported by:	Bill Huey <billh@gnuppy.monkey.org>
This commit is contained in:
deischen 2002-07-09 13:24:52 +00:00
parent ebfe0ebcf1
commit b6d9a54d77
3 changed files with 9 additions and 6 deletions

View File

@ -207,9 +207,10 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
/* Add the thread to the linked list of all threads: */
TAILQ_INSERT_HEAD(&_thread_list, new_thread, tle);
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED)
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED) {
new_thread->flags |= PTHREAD_FLAGS_SUSPENDED;
new_thread->state = PS_SUSPENDED;
else {
} else {
new_thread->state = PS_RUNNING;
PTHREAD_PRIOQ_INSERT_TAIL(new_thread);
}

View File

@ -207,9 +207,10 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
/* Add the thread to the linked list of all threads: */
TAILQ_INSERT_HEAD(&_thread_list, new_thread, tle);
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED)
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED) {
new_thread->flags |= PTHREAD_FLAGS_SUSPENDED;
new_thread->state = PS_SUSPENDED;
else {
} else {
new_thread->state = PS_RUNNING;
PTHREAD_PRIOQ_INSERT_TAIL(new_thread);
}

View File

@ -207,9 +207,10 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
/* Add the thread to the linked list of all threads: */
TAILQ_INSERT_HEAD(&_thread_list, new_thread, tle);
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED)
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED) {
new_thread->flags |= PTHREAD_FLAGS_SUSPENDED;
new_thread->state = PS_SUSPENDED;
else {
} else {
new_thread->state = PS_RUNNING;
PTHREAD_PRIOQ_INSERT_TAIL(new_thread);
}