[Pkg-voip-commits] [janus] 59/163: mutex: add alias for PTHREAD_MUTEX_INITIALIZER

Jonas Smedegaard dr at jones.dk
Sat Oct 28 01:22:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.5-1
in repository janus.

commit 00ef8f731b9e4b71e4e3c4e41963e88ac50cf67f
Author: Tristan Matthews <tmatth at videolan.org>
Date:   Tue Aug 1 17:28:36 2017 -0400

    mutex: add alias for PTHREAD_MUTEX_INITIALIZER
    
    Used for initializing statically allocated mutexes.
    
    Rationale: guarantees that mutexes are initialized when first accessed
    in case one gets read before the code initializing it with janus_mutex_init()
    is called. Also avoids checks that are unnecessary for statically allocated
    mutexes.
---
 mutex.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mutex.h b/mutex.h
index 07b9d32..bc88430 100644
--- a/mutex.h
+++ b/mutex.h
@@ -19,6 +19,8 @@ extern int lock_debug;
 typedef pthread_mutex_t janus_mutex;
 /*! \brief Janus mutex initialization */
 #define janus_mutex_init(a) pthread_mutex_init(a,NULL)
+/*! \brief Janus static mutex initializer */
+#define JANUS_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
 /*! \brief Janus mutex destruction */
 #define janus_mutex_destroy(a) pthread_mutex_destroy(a)
 /*! \brief Janus mutex lock without debug */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list