* k5-thread.h (krb5int_pthread_loaded) [HAVE_PRAGMA_WEAK_REF]: Declare.
authorKen Raeburn <raeburn@mit.edu>
Wed, 1 Jun 2005 01:57:15 +0000 (01:57 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 1 Jun 2005 01:57:15 +0000 (01:57 +0000)
(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
src/include/k5-thread.h

index d380b5641e05e00e2ff02a0e9a0e8e6bcd96c8ac..217c6a59c562e75435a7331a03517a69f8df8bd8 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-31  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * k5-int.h (encode_krb5_sam_challenge, encode_krb5_sam_key,
index 2caf8ecc9e8aa791dc781f9dc68bc066ccaef4b5..80f659a1fd67a9b5f381c4491e5cc0dd10fa65ea 100644 (file)
@@ -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