From 2c0b891afe29dd28d0e6d75e0da8681db7fd100d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 24 Mar 2004 06:36:06 +0000 Subject: Update. * sysdeps/unix/sysv/linux/smp.h: New file. * sysdeps/unix/sysv/linux/sh/smp.h: New file. * init.c: Define __is_smp. (__pthread_initialize_minimal_internal): Call is_smp_system to initialize __is_smp. * pthreadP.h: Declare __is_smp. Define MAX_ADAPTIVE_COUNT is necessary. * pthread_mutex_init.c: Add comment regarding __spins field. * pthread_mutex_lock.c: Implement adaptive mutex type. * pthread_mutex_timedlock.c: Likewise. * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t): Add __spins field. * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define lll_mutex_cond_trylock. * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise. Define BUSY_WAIT_NOP. * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise. * tst-mutex5.c: Add support for testing adaptive mutexes. * tst-mutex7.c: Likewise. * tst-mutex5a.c: New file. * tst-mutex7a.c: New file. * Makefile (tests): Add tst-mutex5a and tst-mutex7a. --- nptl/init.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nptl/init.c') diff --git a/nptl/init.c b/nptl/init.c index f46e0bb531..47bb0a6f72 100644 --- a/nptl/init.c +++ b/nptl/init.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifndef __NR_set_tid_address @@ -61,6 +62,9 @@ size_t __default_stacksize attribute_hidden; size_t __static_tls_size; size_t __static_tls_align_m1; +/* Flag whether the machine is SMP or not. */ +int __is_smp attribute_hidden; + /* Version of the library, used in libthread_db to detect mismatches. */ static const char nptl_version[] __attribute_used__ = VERSION; @@ -301,6 +305,9 @@ __pthread_initialize_minimal_internal (void) #endif __libc_pthread_init (&__fork_generation, __reclaim_stacks, ptr_pthread_functions); + + /* Determine whether the machine is SMP or not. */ + __is_smp = is_smp_system (); } strong_alias (__pthread_initialize_minimal_internal, __pthread_initialize_minimal) -- cgit 1.4.1