[asterisk-commits] russell: branch group/asterisk-cpp r168477 - /team/group/asterisk-cpp/include...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 12 07:49:26 CST 2009


Author: russell
Date: Mon Jan 12 07:49:25 2009
New Revision: 168477

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168477
Log:
We can't use the MUTEX_INIT_VALUE like this, it's only valid for linux

Modified:
    team/group/asterisk-cpp/include/asterisk/linkedlists.h

Modified: team/group/asterisk-cpp/include/asterisk/linkedlists.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/linkedlists.h?view=diff&rev=168477&r1=168476&r2=168477
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/linkedlists.h (original)
+++ team/group/asterisk-cpp/include/asterisk/linkedlists.h Mon Jan 12 07:49:25 2009
@@ -142,7 +142,8 @@
 */
 #define AST_LIST_HEAD(name, type)					\
 struct name {								\
-	name() : first(NULL), last(NULL), lock(AST_MUTEX_INIT_VALUE){} \
+	name() : first(NULL), last(NULL) { ast_mutex_init(&lock); } \
+	~name() { ast_mutex_destroy(&lock); } \
 	struct type *first;						\
 	struct type *last;						\
 	ast_mutex_t lock;						\
@@ -245,7 +246,7 @@
 */
 #define AST_LIST_HEAD_STATIC(name, type)				\
 struct name {								\
-	name(void) { ast_mutex_init(&lock); }   \
+	name(void) : first(NULL), last(NULL) { ast_mutex_init(&lock); }   \
 	~name(void) { ast_mutex_destroy(&lock); } \
 	struct type *first;						\
 	struct type *last;						\
@@ -271,7 +272,7 @@
 */
 #define AST_RWLIST_HEAD_STATIC(name, type)                              \
 struct name {                                                           \
-        name(void) { ast_rwlock_init(&lock); }                          \
+        name(void) : first(NULL), last(NULL) { ast_rwlock_init(&lock); }                          \
         ~name(void) { ast_rwlock_destroy(&lock); }                      \
         struct type *first;                                             \
         struct type *last;                                              \




More information about the asterisk-commits mailing list