thr_init.c (155739) | thr_init.c (156319) |
---|---|
1/* 2 * Copyright (c) 2003 Daniel M. Eischen <deischen@freebsd.org> 3 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 1/* 2 * Copyright (c) 2003 Daniel M. Eischen <deischen@freebsd.org> 3 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $FreeBSD: head/lib/libthr/thread/thr_init.c 155739 2006-02-15 23:05:03Z davidxu $ | 33 * $FreeBSD: head/lib/libthr/thread/thr_init.c 156319 2006-03-05 18:10:28Z deischen $ |
34 */ 35 36#include "namespace.h" 37#include <sys/types.h> 38#include <sys/signalvar.h> 39#include <sys/ioctl.h> 40#include <sys/sysctl.h> 41#include <sys/ttycom.h> --- 151 unchanged lines hidden (view full) --- 193 194/* Pull in all symbols required by libthread_db */ 195STATIC_LIB_REQUIRE(_thread_state_running); 196 197#define DUAL_ENTRY(entry) \ 198 (pthread_func_t)entry, (pthread_func_t)entry 199 200static pthread_func_t jmp_table[][2] = { | 34 */ 35 36#include "namespace.h" 37#include <sys/types.h> 38#include <sys/signalvar.h> 39#include <sys/ioctl.h> 40#include <sys/sysctl.h> 41#include <sys/ttycom.h> --- 151 unchanged lines hidden (view full) --- 193 194/* Pull in all symbols required by libthread_db */ 195STATIC_LIB_REQUIRE(_thread_state_running); 196 197#define DUAL_ENTRY(entry) \ 198 (pthread_func_t)entry, (pthread_func_t)entry 199 200static pthread_func_t jmp_table[][2] = { |
201 {DUAL_ENTRY(_pthread_atfork)}, /* PJT_ATFORK */ 202 {DUAL_ENTRY(_pthread_attr_destroy)}, /* PJT_ATTR_DESTROY */ 203 {DUAL_ENTRY(_pthread_attr_getdetachstate)}, /* PJT_ATTR_GETDETACHSTATE */ 204 {DUAL_ENTRY(_pthread_attr_getguardsize)}, /* PJT_ATTR_GETGUARDSIZE */ 205 {DUAL_ENTRY(_pthread_attr_getinheritsched)}, /* PJT_ATTR_GETINHERITSCHED */ 206 {DUAL_ENTRY(_pthread_attr_getschedparam)}, /* PJT_ATTR_GETSCHEDPARAM */ 207 {DUAL_ENTRY(_pthread_attr_getschedpolicy)}, /* PJT_ATTR_GETSCHEDPOLICY */ 208 {DUAL_ENTRY(_pthread_attr_getscope)}, /* PJT_ATTR_GETSCOPE */ 209 {DUAL_ENTRY(_pthread_attr_getstackaddr)}, /* PJT_ATTR_GETSTACKADDR */ 210 {DUAL_ENTRY(_pthread_attr_getstacksize)}, /* PJT_ATTR_GETSTACKSIZE */ 211 {DUAL_ENTRY(_pthread_attr_init)}, /* PJT_ATTR_INIT */ 212 {DUAL_ENTRY(_pthread_attr_setdetachstate)}, /* PJT_ATTR_SETDETACHSTATE */ 213 {DUAL_ENTRY(_pthread_attr_setguardsize)}, /* PJT_ATTR_SETGUARDSIZE */ 214 {DUAL_ENTRY(_pthread_attr_setinheritsched)}, /* PJT_ATTR_SETINHERITSCHED */ 215 {DUAL_ENTRY(_pthread_attr_setschedparam)}, /* PJT_ATTR_SETSCHEDPARAM */ 216 {DUAL_ENTRY(_pthread_attr_setschedpolicy)}, /* PJT_ATTR_SETSCHEDPOLICY */ 217 {DUAL_ENTRY(_pthread_attr_setscope)}, /* PJT_ATTR_SETSCOPE */ 218 {DUAL_ENTRY(_pthread_attr_setstackaddr)}, /* PJT_ATTR_SETSTACKADDR */ 219 {DUAL_ENTRY(_pthread_attr_setstacksize)}, /* PJT_ATTR_SETSTACKSIZE */ 220 {DUAL_ENTRY(_pthread_cancel)}, /* PJT_CANCEL */ 221 {DUAL_ENTRY(_pthread_cleanup_pop)}, /* PJT_CLEANUP_POP */ 222 {DUAL_ENTRY(_pthread_cleanup_push)}, /* PJT_CLEANUP_PUSH */ |
|
201 {DUAL_ENTRY(_pthread_cond_broadcast)}, /* PJT_COND_BROADCAST */ 202 {DUAL_ENTRY(_pthread_cond_destroy)}, /* PJT_COND_DESTROY */ 203 {DUAL_ENTRY(_pthread_cond_init)}, /* PJT_COND_INIT */ 204 {DUAL_ENTRY(_pthread_cond_signal)}, /* PJT_COND_SIGNAL */ | 223 {DUAL_ENTRY(_pthread_cond_broadcast)}, /* PJT_COND_BROADCAST */ 224 {DUAL_ENTRY(_pthread_cond_destroy)}, /* PJT_COND_DESTROY */ 225 {DUAL_ENTRY(_pthread_cond_init)}, /* PJT_COND_INIT */ 226 {DUAL_ENTRY(_pthread_cond_signal)}, /* PJT_COND_SIGNAL */ |
227 {DUAL_ENTRY(_pthread_cond_timedwait)}, /* PJT_COND_TIMEDWAIT */ |
|
205 {(pthread_func_t)__pthread_cond_wait, 206 (pthread_func_t)_pthread_cond_wait}, /* PJT_COND_WAIT */ | 228 {(pthread_func_t)__pthread_cond_wait, 229 (pthread_func_t)_pthread_cond_wait}, /* PJT_COND_WAIT */ |
230 {DUAL_ENTRY(_pthread_detach)}, /* PJT_DETACH */ 231 {DUAL_ENTRY(_pthread_equal)}, /* PJT_EQUAL */ 232 {DUAL_ENTRY(_pthread_exit)}, /* PJT_EXIT */ |
|
207 {DUAL_ENTRY(_pthread_getspecific)}, /* PJT_GETSPECIFIC */ | 233 {DUAL_ENTRY(_pthread_getspecific)}, /* PJT_GETSPECIFIC */ |
234 {DUAL_ENTRY(_pthread_join)}, /* PJT_JOIN */ |
|
208 {DUAL_ENTRY(_pthread_key_create)}, /* PJT_KEY_CREATE */ 209 {DUAL_ENTRY(_pthread_key_delete)}, /* PJT_KEY_DELETE*/ | 235 {DUAL_ENTRY(_pthread_key_create)}, /* PJT_KEY_CREATE */ 236 {DUAL_ENTRY(_pthread_key_delete)}, /* PJT_KEY_DELETE*/ |
237 {DUAL_ENTRY(_pthread_kill)}, /* PJT_KILL */ |
|
210 {DUAL_ENTRY(_pthread_main_np)}, /* PJT_MAIN_NP */ | 238 {DUAL_ENTRY(_pthread_main_np)}, /* PJT_MAIN_NP */ |
239 {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ 240 {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ 241 {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ |
|
211 {DUAL_ENTRY(_pthread_mutex_destroy)}, /* PJT_MUTEX_DESTROY */ 212 {DUAL_ENTRY(_pthread_mutex_init)}, /* PJT_MUTEX_INIT */ 213 {(pthread_func_t)__pthread_mutex_lock, 214 (pthread_func_t)_pthread_mutex_lock}, /* PJT_MUTEX_LOCK */ 215 {(pthread_func_t)__pthread_mutex_trylock, 216 (pthread_func_t)_pthread_mutex_trylock},/* PJT_MUTEX_TRYLOCK */ 217 {DUAL_ENTRY(_pthread_mutex_unlock)}, /* PJT_MUTEX_UNLOCK */ | 242 {DUAL_ENTRY(_pthread_mutex_destroy)}, /* PJT_MUTEX_DESTROY */ 243 {DUAL_ENTRY(_pthread_mutex_init)}, /* PJT_MUTEX_INIT */ 244 {(pthread_func_t)__pthread_mutex_lock, 245 (pthread_func_t)_pthread_mutex_lock}, /* PJT_MUTEX_LOCK */ 246 {(pthread_func_t)__pthread_mutex_trylock, 247 (pthread_func_t)_pthread_mutex_trylock},/* PJT_MUTEX_TRYLOCK */ 248 {DUAL_ENTRY(_pthread_mutex_unlock)}, /* PJT_MUTEX_UNLOCK */ |
218 {DUAL_ENTRY(_pthread_mutexattr_destroy)}, /* PJT_MUTEXATTR_DESTROY */ 219 {DUAL_ENTRY(_pthread_mutexattr_init)}, /* PJT_MUTEXATTR_INIT */ 220 {DUAL_ENTRY(_pthread_mutexattr_settype)}, /* PJT_MUTEXATTR_SETTYPE */ | |
221 {DUAL_ENTRY(_pthread_once)}, /* PJT_ONCE */ 222 {DUAL_ENTRY(_pthread_rwlock_destroy)}, /* PJT_RWLOCK_DESTROY */ 223 {DUAL_ENTRY(_pthread_rwlock_init)}, /* PJT_RWLOCK_INIT */ 224 {DUAL_ENTRY(_pthread_rwlock_rdlock)}, /* PJT_RWLOCK_RDLOCK */ 225 {DUAL_ENTRY(_pthread_rwlock_tryrdlock)},/* PJT_RWLOCK_TRYRDLOCK */ 226 {DUAL_ENTRY(_pthread_rwlock_trywrlock)},/* PJT_RWLOCK_TRYWRLOCK */ 227 {DUAL_ENTRY(_pthread_rwlock_unlock)}, /* PJT_RWLOCK_UNLOCK */ 228 {DUAL_ENTRY(_pthread_rwlock_wrlock)}, /* PJT_RWLOCK_WRLOCK */ 229 {DUAL_ENTRY(_pthread_self)}, /* PJT_SELF */ | 249 {DUAL_ENTRY(_pthread_once)}, /* PJT_ONCE */ 250 {DUAL_ENTRY(_pthread_rwlock_destroy)}, /* PJT_RWLOCK_DESTROY */ 251 {DUAL_ENTRY(_pthread_rwlock_init)}, /* PJT_RWLOCK_INIT */ 252 {DUAL_ENTRY(_pthread_rwlock_rdlock)}, /* PJT_RWLOCK_RDLOCK */ 253 {DUAL_ENTRY(_pthread_rwlock_tryrdlock)},/* PJT_RWLOCK_TRYRDLOCK */ 254 {DUAL_ENTRY(_pthread_rwlock_trywrlock)},/* PJT_RWLOCK_TRYWRLOCK */ 255 {DUAL_ENTRY(_pthread_rwlock_unlock)}, /* PJT_RWLOCK_UNLOCK */ 256 {DUAL_ENTRY(_pthread_rwlock_wrlock)}, /* PJT_RWLOCK_WRLOCK */ 257 {DUAL_ENTRY(_pthread_self)}, /* PJT_SELF */ |
258 {DUAL_ENTRY(_pthread_setcancelstate)}, /* PJT_SETCANCELSTATE */ 259 {DUAL_ENTRY(_pthread_setcanceltype)}, /* PJT_SETCANCELTYPE */ |
|
230 {DUAL_ENTRY(_pthread_setspecific)}, /* PJT_SETSPECIFIC */ | 260 {DUAL_ENTRY(_pthread_setspecific)}, /* PJT_SETSPECIFIC */ |
231 {DUAL_ENTRY(_pthread_sigmask)} /* PJT_SIGMASK */ | 261 {DUAL_ENTRY(_pthread_sigmask)}, /* PJT_SIGMASK */ 262 {DUAL_ENTRY(_pthread_testcancel)} /* PJT_TESTCANCEL */ |
232}; 233 234static int init_once = 0; 235 236/* 237 * For the shared version of the threads library, the above is sufficient. 238 * But for the archive version of the library, we need a little bit more. 239 * Namely, we must arrange for this particular module to be pulled in from --- 207 unchanged lines hidden --- | 263}; 264 265static int init_once = 0; 266 267/* 268 * For the shared version of the threads library, the above is sufficient. 269 * But for the archive version of the library, we need a little bit more. 270 * Namely, we must arrange for this particular module to be pulled in from --- 207 unchanged lines hidden --- |