* k5-thread.h [HAVE_PRAGMA_WEAK_REF]: Declare the pthread mutex functions as
authorKen Raeburn <raeburn@mit.edu>
Wed, 28 Jul 2004 23:38:54 +0000 (23:38 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 28 Jul 2004 23:38:54 +0000 (23:38 +0000)
weak.
(USE_PTHREAD_LOCK_ONLY_IF_LOADED): Define if pthread_mutex_lock isn't available
by default.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16625 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/k5-thread.h

index 103d4d7d7e562a29f2201399b89e15dff852cdf2..f41ec9e958968322575c6af2a61fd1232133189f 100644 (file)
@@ -1,3 +1,10 @@
+2004-07-28  Ken Raeburn  <raeburn@mit.edu>
+
+       * k5-thread.h [HAVE_PRAGMA_WEAK_REF]: Declare the pthread mutex
+       functions as weak.
+       (USE_PTHREAD_LOCK_ONLY_IF_LOADED): Define if pthread_mutex_lock
+       isn't available by default.
+
 2004-07-23  Ken Raeburn  <raeburn@mit.edu>
 
        * fake-addrinfo.h: Include k5-thread.h.
index 74e3843666989ba796f6cb7eca190b515f964092..97247c5b8fb81af0a099d0475fc226b2ff4e8330 100644 (file)
@@ -349,6 +349,10 @@ typedef k5_os_nothread_mutex k5_os_mutex;
    symbol tables of the current process.  */
 #ifdef HAVE_PRAGMA_WEAK_REF
 # pragma weak pthread_once
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+# pragma weak pthread_mutex_destroy
+# pragma weak pthread_mutex_init
 # ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP_IN_THREAD_LIB
 #  pragma weak pthread_mutexattr_setrobust_np
 # endif
@@ -383,6 +387,10 @@ typedef k5_os_nothread_mutex k5_os_mutex;
 # define USE_PTHREAD_LOCK_ONLY_IF_LOADED
 #endif
 
+#if !defined(HAVE_PTHREAD_MUTEX_LOCK) && !defined(USE_PTHREAD_LOCK_ONLY_IF_LOADED)
+# define USE_PTHREAD_LOCK_ONLY_IF_LOADED
+#endif
+
 #ifdef HAVE_PRAGMA_WEAK_REF
 /* Can't rely on useful stubs -- see above regarding Solaris.  */
 typedef struct {