summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2005-06-01 01:57:15 +0000
committerKen Raeburn <raeburn@mit.edu>2005-06-01 01:57:15 +0000
commit9b83195969ae60c995ae2695e48fb563efcf1a63 (patch)
tree19fd1f22f2a9ceff62742ef049869a441075ce4a /src
parentf249fb8ae3f7ee30805efdda0375868a5b636a3f (diff)
downloadkrb5-9b83195969ae60c995ae2695e48fb563efcf1a63.tar.gz
krb5-9b83195969ae60c995ae2695e48fb563efcf1a63.tar.xz
krb5-9b83195969ae60c995ae2695e48fb563efcf1a63.zip
* 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
Diffstat (limited to 'src')
-rw-r--r--src/include/ChangeLog6
-rw-r--r--src/include/k5-thread.h12
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 <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,
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