thr_join.c (112918) | thr_join.c (112960) |
---|---|
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/libthr/thread/thr_join.c 112918 2003-04-01 03:46:29Z jeff $ | 32 * $FreeBSD: head/lib/libthr/thread/thr_join.c 112960 2003-04-01 22:41:41Z jeff $ |
33 */ 34#include <errno.h> 35#include <pthread.h> 36#include "thr_private.h" 37 38__weak_reference(_pthread_join, pthread_join); 39 40int --- 78 unchanged lines hidden (view full) --- 119 pthread->joiner = curthread; 120 121 /* Keep track of which thread we're joining to: */ 122 curthread->join_status.thread = pthread; 123 124 while (curthread->join_status.thread == pthread) { 125 PTHREAD_SET_STATE(curthread, PS_JOIN); 126 /* Wait for our signal to wake up. */ | 33 */ 34#include <errno.h> 35#include <pthread.h> 36#include "thr_private.h" 37 38__weak_reference(_pthread_join, pthread_join); 39 40int --- 78 unchanged lines hidden (view full) --- 119 pthread->joiner = curthread; 120 121 /* Keep track of which thread we're joining to: */ 122 curthread->join_status.thread = pthread; 123 124 while (curthread->join_status.thread == pthread) { 125 PTHREAD_SET_STATE(curthread, PS_JOIN); 126 /* Wait for our signal to wake up. */ |
127 GIANT_UNLOCK(curthread); |
|
127 _thread_suspend(curthread, NULL); | 128 _thread_suspend(curthread, NULL); |
129 GIANT_LOCK(curthread); |
|
128 } 129 130 /* 131 * The thread return value and error are set by the thread we're 132 * joining to when it exits or detaches: 133 */ 134 ret = curthread->join_status.error; 135 if ((ret == 0) && (thread_return != NULL)) --- 26 unchanged lines hidden --- | 130 } 131 132 /* 133 * The thread return value and error are set by the thread we're 134 * joining to when it exits or detaches: 135 */ 136 ret = curthread->join_status.error; 137 if ((ret == 0) && (thread_return != NULL)) --- 26 unchanged lines hidden --- |