thr_exit.c (177605) | thr_exit.c (178647) |
---|---|
1/* 2 * Copyright (c) 1995-1998 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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/* 2 * Copyright (c) 1995-1998 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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/lib/libthr/thread/thr_exit.c 177605 2008-03-25 13:28:12Z ru $ | 29 * $FreeBSD: head/lib/libthr/thread/thr_exit.c 178647 2008-04-29 03:58:18Z davidxu $ |
30 */ 31 32#include "namespace.h" 33#include <errno.h> 34#include <stdio.h> 35#include <stdlib.h> 36#include <pthread.h> 37#include "un-namespace.h" --- 82 unchanged lines hidden (view full) --- 120 THREAD_LIST_UNLOCK(curthread); 121 exit(0); 122 /* Never reach! */ 123 } 124 THR_LOCK(curthread); 125 curthread->state = PS_DEAD; 126 if (curthread->flags & THR_FLAGS_NEED_SUSPEND) { 127 curthread->cycle++; | 30 */ 31 32#include "namespace.h" 33#include <errno.h> 34#include <stdio.h> 35#include <stdlib.h> 36#include <pthread.h> 37#include "un-namespace.h" --- 82 unchanged lines hidden (view full) --- 120 THREAD_LIST_UNLOCK(curthread); 121 exit(0); 122 /* Never reach! */ 123 } 124 THR_LOCK(curthread); 125 curthread->state = PS_DEAD; 126 if (curthread->flags & THR_FLAGS_NEED_SUSPEND) { 127 curthread->cycle++; |
128 _thr_umtx_wake(&curthread->cycle, INT_MAX); | 128 _thr_umtx_wake(&curthread->cycle, INT_MAX, 0); |
129 } 130 THR_UNLOCK(curthread); 131 /* 132 * Thread was created with initial refcount 1, we drop the 133 * reference count to allow it to be garbage collected. 134 */ 135 curthread->refcount--; 136 if (curthread->tlflags & TLFLAGS_DETACHED) --- 13 unchanged lines hidden --- | 129 } 130 THR_UNLOCK(curthread); 131 /* 132 * Thread was created with initial refcount 1, we drop the 133 * reference count to allow it to be garbage collected. 134 */ 135 curthread->refcount--; 136 if (curthread->tlflags & TLFLAGS_DETACHED) --- 13 unchanged lines hidden --- |