[asterisk-commits] rmudgett: trunk r357404 - in /trunk: apps/ main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 28 14:34:15 CST 2012


Author: rmudgett
Date: Tue Feb 28 14:34:11 2012
New Revision: 357404

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=357404
Log:
Fix REF_DEBUG compile errors.

Modified:
    trunk/apps/app_queue.c
    trunk/main/channel.c
    trunk/res/res_musiconhold.c

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=357404&r1=357403&r2=357404
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Tue Feb 28 14:34:11 2012
@@ -1291,17 +1291,32 @@
 }
 
 #ifdef REF_DEBUG_ONLY_QUEUES
-#define queue_ref(a)	__ao2_ref_debug(a,1,"",__FILE__,__LINE__,__PRETTY_FUNCTION__)
-#define queue_unref(a)	__ao2_ref_debug(a,-1,"",__FILE__,__LINE__,__PRETTY_FUNCTION__)
-#define queue_t_ref(a,b)	__ao2_ref_debug(a,1,b,__FILE__,__LINE__,__PRETTY_FUNCTION__)
-#define queue_t_unref(a,b)	__ao2_ref_debug(a,-1,b,__FILE__,__LINE__,__PRETTY_FUNCTION__)
-#define queues_t_link(c,q,tag)	__ao2_link_debug(c,q,tag,__FILE__,__LINE__,__PRETTY_FUNCTION__)
-#define queues_t_unlink(c,q,tag)	__ao2_unlink_debug(c,q,tag,__FILE__,__LINE__,__PRETTY_FUNCTION__)
+#define queue_ref(q)				_queue_ref(q, "", __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define queue_unref(q)				_queue_unref(q, "", __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define queue_t_ref(q, tag)			_queue_ref(q, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define queue_t_unref(q, tag)		_queue_unref(q, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define queues_t_link(c, q, tag)	__ao2_link_debug(c, q, 0, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define queues_t_unlink(c, q, tag)	__ao2_unlink_debug(c, q, 0, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline struct call_queue *_queue_ref(struct call_queue *q, const char *tag, const char *file, int line, const char *filename)
+{
+	__ao2_ref_debug(q, 1, tag, file, line, filename);
+	return q;
+}
+
+static inline struct call_queue *_queue_unref(struct call_queue *q, const char *tag, const char *file, int line, const char *filename)
+{
+	__ao2_ref_debug(q, -1, tag, file, line, filename);
+	return NULL;
+}
+
 #else
-#define queue_t_ref(a,b)	queue_ref(a)
-#define queue_t_unref(a,b)	queue_unref(a)
-#define queues_t_link(c,q,tag)	ao2_t_link(c,q,tag)
-#define queues_t_unlink(c,q,tag)	ao2_t_unlink(c,q,tag)
+
+#define queue_t_ref(q, tag)			queue_ref(q)
+#define queue_t_unref(q, tag)		queue_unref(q)
+#define queues_t_link(c, q, tag)	ao2_t_link(c, q, tag)
+#define queues_t_unlink(c, q, tag)	ao2_t_unlink(c, q, tag)
+
 static inline struct call_queue *queue_ref(struct call_queue *q)
 {
 	ao2_ref(q, 1);

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=357404&r1=357403&r2=357404
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Feb 28 14:34:11 2012
@@ -931,11 +931,11 @@
 	}
 
 #if defined(REF_DEBUG)
-	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_channel_destructor, "", file, line,
-		function, 1);
+	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_channel_destructor,
+		AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function, 1);
 #elif defined(__AST_DEBUG_MALLOC)
-	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_channel_destructor, "", file, line,
-		function, 0);
+	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_channel_destructor,
+		AO2_ALLOC_OPT_LOCK_MUTEX, "", file, line, function, 0);
 #else
 	tmp = ao2_alloc(sizeof(*tmp), ast_channel_destructor);
 #endif
@@ -1179,11 +1179,11 @@
 	struct varshead *headp;
 
 #if defined(REF_DEBUG)
-	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor, "dummy channel",
-		file, line, function, 1);
+	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor,
+		AO2_ALLOC_OPT_LOCK_MUTEX, "dummy channel", file, line, function, 1);
 #elif defined(__AST_DEBUG_MALLOC)
-	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor, "dummy channel",
-		file, line, function, 0);
+	tmp = __ao2_alloc_debug(sizeof(*tmp), ast_dummy_channel_destructor,
+		AO2_ALLOC_OPT_LOCK_MUTEX, "dummy channel", file, line, function, 0);
 #else
 	tmp = ao2_alloc(sizeof(*tmp), ast_dummy_channel_destructor);
 #endif

Modified: trunk/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=357404&r1=357403&r2=357404
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Tue Feb 28 14:34:11 2012
@@ -889,7 +889,8 @@
 	ast_copy_string(tmp_class.name, name, sizeof(tmp_class.name));
 
 #ifdef REF_DEBUG
-	moh = __ao2_find_debug(mohclasses, &tmp_class, flags, "get_mohbyname", (char *) file, lineno, funcname);
+	moh = __ao2_find_debug(mohclasses, &tmp_class, flags,
+		"get_mohbyname", file, lineno, funcname);
 #else
 	moh = __ao2_find(mohclasses, &tmp_class, flags);
 #endif
@@ -1338,9 +1339,11 @@
 
 	if ((class =
 #ifdef REF_DEBUG
-			__ao2_alloc_debug(sizeof(*class), moh_class_destructor, "Allocating new moh class", file, line, funcname, 1)
+			__ao2_alloc_debug(sizeof(*class), moh_class_destructor,
+				AO2_ALLOC_OPT_LOCK_MUTEX, "Allocating new moh class", file, line, funcname, 1)
 #elif defined(__AST_DEBUG_MALLOC)
-			__ao2_alloc_debug(sizeof(*class), moh_class_destructor, "Allocating new moh class", file, line, funcname, 0)
+			__ao2_alloc_debug(sizeof(*class), moh_class_destructor,
+				AO2_ALLOC_OPT_LOCK_MUTEX, "Allocating new moh class", file, line, funcname, 0)
 #else
 			ao2_alloc(sizeof(*class), moh_class_destructor)
 #endif




More information about the asterisk-commits mailing list