From ae9cae48c8d550f39039b874da786978f5bee282 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 14 Jul 2004 00:15:23 +0000 Subject: [PATCH] * 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16587 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 6 ++++++ src/include/k5-thread.h | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 197468696..9110348df 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,9 @@ +2004-07-13 Ken Raeburn + + * 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 * k5-thread.h (k5_os_mutex_lock, k5_os_mutex_unlock, diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h index 4d1a6fca5..7256a3c77 100644 --- a/src/include/k5-thread.h +++ b/src/include/k5-thread.h @@ -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 \ -- 2.26.2