aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-11-27 16:55:29 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-11-27 17:50:35 +0300
commit201a12289de9f50092a7a4aa804159ccbf7166a9 (patch)
tree1e4585ed70fbcb7cb68133f693b809596e5a58bc
parentc49871e76c68ae2c0a0794b4de486a531c5d48ac (diff)
downloadlibmicrohttpd-201a12289de9f50092a7a4aa804159ccbf7166a9.tar.gz
libmicrohttpd-201a12289de9f50092a7a4aa804159ccbf7166a9.zip
mhd_locks: added ability to statically initialise mutex,
if supported by mutex library
-rw-r--r--src/microhttpd/mhd_locks.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/microhttpd/mhd_locks.h b/src/microhttpd/mhd_locks.h
index 4f2c17e5..21db56c4 100644
--- a/src/microhttpd/mhd_locks.h
+++ b/src/microhttpd/mhd_locks.h
@@ -86,6 +86,15 @@
86#endif 86#endif
87 87
88#if defined(MHD_PTHREAD_MUTEX_) 88#if defined(MHD_PTHREAD_MUTEX_)
89# if defined(PTHREAD_MUTEX_INITIALIZER)
90/**
91 * Define static mutex and statically initialise it.
92 */
93# define MHD_MUTEX_STATIC_DEFN_INIT_(m) static MHD_mutex_ m = PTHREAD_MUTEX_INITIALIZER
94# endif /* PTHREAD_MUTEX_INITIALIZER */
95#endif
96
97#if defined(MHD_PTHREAD_MUTEX_)
89/** 98/**
90 * Destroy previously initialised mutex. 99 * Destroy previously initialised mutex.
91 * @param pmutex pointer to mutex 100 * @param pmutex pointer to mutex