summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/ChangeLog6
-rw-r--r--src/include/k5-thread.h8
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 <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,
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 \