* k5-thread.h (k5_os_mutex_init, k5_os_mutex_destroy): If
authorKen Raeburn <raeburn@mit.edu>
Wed, 14 Jul 2004 00:15:23 +0000 (00:15 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 14 Jul 2004 00:15:23 +0000 (00:15 +0000)
USE_PTHREAD_LOCK_ONLY_IF_LOADED is defined, use pthread_mutex_init and _destroy
only if pthread support is loaded.

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

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

index 1974686961cd64ad6a5dfcc2b92c9328493d65a0..9110348df74cb752e769881db6909b85447f7a0e 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-13  Ken Raeburn  <raeburn@mit.edu>
+
+       * k5-thread.h (k5_os_mutex_init, k5_os_mutex_destroy): If
+       USE_PTHREAD_LOCK_ONLY_IF_LOADED is defined, use pthread_mutex_init
+       and _destroy only if pthread support is loaded.
+
 2004-07-11  Ken Raeburn  <raeburn@mit.edu>
 
        * k5-thread.h (k5_os_mutex_lock, k5_os_mutex_unlock,
index 4d1a6fca58157b47111b7c2a04eecb1a4e66747c..7256a3c776a3ae3acb3b24713d41bb11a167c76a 100644 (file)
@@ -418,10 +418,14 @@ typedef struct {
        k5_os_nothread_mutex_finish_init(&(M)->n)
 # define k5_os_mutex_init(M)                   \
        (k5_os_nothread_mutex_init(&(M)->n),    \
-        pthread_mutex_init(&(M)->p, 0))
+        (K5_PTHREADS_LOADED                    \
+         ? pthread_mutex_init(&(M)->p, 0)      \
+         : 0))
 # define k5_os_mutex_destroy(M)                        \
        (k5_os_nothread_mutex_destroy(&(M)->n), \
-        pthread_mutex_destroy(&(M)->p))
+        (K5_PTHREADS_LOADED                    \
+         ? pthread_mutex_destroy(&(M)->p)      \
+         : 0))
 
 # define k5_os_mutex_lock(M)                   \
        (K5_PTHREADS_LOADED                     \