thr_resume_np.c (113658) | thr_resume_np.c (113661) |
---|---|
1/* 2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/lib/libkse/thread/thr_resume_np.c 113658 2003-04-18 05:04:16Z deischen $ | 32 * $FreeBSD: head/lib/libkse/thread/thr_resume_np.c 113661 2003-04-18 07:09:43Z deischen $ |
33 */ 34#include <errno.h> 35#include <pthread.h> 36#include "thr_private.h" 37 38static void resume_common(struct pthread *); 39 40__weak_reference(_pthread_resume_np, pthread_resume_np); --- 9 unchanged lines hidden (view full) --- 50 51 /* Add a reference to the thread: */ 52 if ((ret = _thr_ref_add(curthread, thread, /*include dead*/0)) == 0) { 53 /* Is it currently suspended? */ 54 if ((thread->flags & THR_FLAGS_SUSPENDED) != 0) { 55 /* Lock the threads scheduling queue: */ 56 THR_SCHED_LOCK(curthread, thread); 57 | 33 */ 34#include <errno.h> 35#include <pthread.h> 36#include "thr_private.h" 37 38static void resume_common(struct pthread *); 39 40__weak_reference(_pthread_resume_np, pthread_resume_np); --- 9 unchanged lines hidden (view full) --- 50 51 /* Add a reference to the thread: */ 52 if ((ret = _thr_ref_add(curthread, thread, /*include dead*/0)) == 0) { 53 /* Is it currently suspended? */ 54 if ((thread->flags & THR_FLAGS_SUSPENDED) != 0) { 55 /* Lock the threads scheduling queue: */ 56 THR_SCHED_LOCK(curthread, thread); 57 |
58 resume_common(thread); | 58 if ((curthread->state != PS_DEAD) && 59 (curthread->state != PS_DEADLOCK) && 60 ((curthread->flags & THR_FLAGS_EXITING) != 0)) 61 resume_common(thread); |
59 60 /* Unlock the threads scheduling queue: */ 61 THR_SCHED_UNLOCK(curthread, thread); 62 } 63 _thr_ref_delete(curthread, thread); 64 } 65 return (ret); 66} --- 43 unchanged lines hidden --- | 62 63 /* Unlock the threads scheduling queue: */ 64 THR_SCHED_UNLOCK(curthread, thread); 65 } 66 _thr_ref_delete(curthread, thread); 67 } 68 return (ret); 69} --- 43 unchanged lines hidden --- |