summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_setschedparam.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-04-18 07:09:43 +0000
committerdeischen <deischen@FreeBSD.org>2003-04-18 07:09:43 +0000
commitd729efd111ee19870b3bb070e86f12c4057aa3b1 (patch)
treec4540fbdb5dd93853283bd4d70315482a539912b /lib/libpthread/thread/thr_setschedparam.c
parent556bb64555ef5aede171c8ea3372a6c814dd324d (diff)
downloadFreeBSD-src-d729efd111ee19870b3bb070e86f12c4057aa3b1.zip
FreeBSD-src-d729efd111ee19870b3bb070e86f12c4057aa3b1.tar.gz
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
Diffstat (limited to 'lib/libpthread/thread/thr_setschedparam.c')
-rw-r--r--lib/libpthread/thread/thr_setschedparam.c7
1 files changed, 7 insertions, 0 deletions
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: */
OpenPOWER on IntegriCloud