From d729efd111ee19870b3bb070e86f12c4057aa3b1 Mon Sep 17 00:00:00 2001 From: deischen Date: Fri, 18 Apr 2003 07:09:43 +0000 Subject: Sorry folks; I accidentally committed a patch from what I was working on a couple of days ago. This should be the most recent changes. Noticed by: davidxu --- lib/libpthread/thread/thr_setschedparam.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/libpthread/thread/thr_setschedparam.c') diff --git a/lib/libpthread/thread/thr_setschedparam.c b/lib/libpthread/thread/thr_setschedparam.c index 1be9f91..18cddfc 100644 --- a/lib/libpthread/thread/thr_setschedparam.c +++ b/lib/libpthread/thread/thr_setschedparam.c @@ -64,6 +64,13 @@ _pthread_setschedparam(pthread_t pthread, int policy, * its priority: */ THR_SCHED_LOCK(curthread, pthread); + if ((pthread->state == PS_DEAD) || + (pthread->state == PS_DEADLOCK) || + ((pthread->flags & THR_FLAGS_EXITING) != 0)) { + THR_SCHED_UNLOCK(curthread, pthread); + _thr_ref_delete(curthread, pthread); + return (ESRCH); + } in_syncq = pthread->flags & THR_FLAGS_IN_SYNCQ; /* Set the scheduling policy: */ -- cgit v1.1