From 582dfa2dd46f85479a256228bcf16eae5e89fce0 Mon Sep 17 00:00:00 2001 From: Daniel Eischen Date: Tue, 9 Jul 2002 13:24:52 +0000 Subject: 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 --- lib/libc_r/uthread/uthread_create.c | 5 +++-- lib/libkse/thread/thr_create.c | 5 +++-- lib/libpthread/thread/thr_create.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/libc_r/uthread/uthread_create.c b/lib/libc_r/uthread/uthread_create.c index f84678992f83..0f006a9aabfc 100644 --- a/lib/libc_r/uthread/uthread_create.c +++ b/lib/libc_r/uthread/uthread_create.c @@ -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); } diff --git a/lib/libkse/thread/thr_create.c b/lib/libkse/thread/thr_create.c index f84678992f83..0f006a9aabfc 100644 --- a/lib/libkse/thread/thr_create.c +++ b/lib/libkse/thread/thr_create.c @@ -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); } diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c index f84678992f83..0f006a9aabfc 100644 --- a/lib/libpthread/thread/thr_create.c +++ b/lib/libpthread/thread/thr_create.c @@ -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); } -- cgit v1.3