From 9b83195969ae60c995ae2695e48fb563efcf1a63 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 1 Jun 2005 01:57:15 +0000 Subject: [PATCH] * k5-thread.h (krb5int_pthread_loaded) [HAVE_PRAGMA_WEAK_REF]: Declare. (K5_PTHREADS_LOADED) [HAVE_PRAGMA_WEAK_REF]: Use it. ticket: 3084 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17224 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 6 ++++++ src/include/k5-thread.h | 12 ++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index d380b5641..217c6a59c 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,9 @@ +2005-05-31 Ken Raeburn + + * k5-thread.h (krb5int_pthread_loaded) [HAVE_PRAGMA_WEAK_REF]: + Declare. + (K5_PTHREADS_LOADED) [HAVE_PRAGMA_WEAK_REF]: Use it. + 2005-05-28 Ken Raeburn * k5-int.h (encode_krb5_sam_challenge, encode_krb5_sam_key, diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h index 2caf8ecc9..80f659a1f 100644 --- a/src/include/k5-thread.h +++ b/src/include/k5-thread.h @@ -410,14 +410,8 @@ typedef k5_os_nothread_mutex k5_os_mutex; # ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP_IN_THREAD_LIB # pragma weak pthread_mutexattr_setrobust_np # endif -# if !defined HAVE_PTHREAD_ONCE -# define K5_PTHREADS_LOADED (&pthread_once != 0) -# elif !defined HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP \ - && defined HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP_IN_THREAD_LIB -# define K5_PTHREADS_LOADED (&pthread_mutexattr_setrobust_np != 0) -# else -# define K5_PTHREADS_LOADED (1) -# endif +extern int krb5int_pthread_loaded(void); +# define K5_PTHREADS_LOADED (krb5int_pthread_loaded()) #else /* no pragma weak support */ # define K5_PTHREADS_LOADED (1) @@ -442,6 +436,8 @@ typedef k5_os_nothread_mutex k5_os_mutex; #endif #if !defined(HAVE_PTHREAD_MUTEX_LOCK) && !defined(USE_PTHREAD_LOCK_ONLY_IF_LOADED) +/* If we find a system with a broken stub for pthread_mutex_lock, + we may have to change this. */ # define USE_PTHREAD_LOCK_ONLY_IF_LOADED #endif -- 2.26.2