[asterisk-commits] trunk r15550 - /trunk/res/res_smdi.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 28 07:15:15 MST 2006


Author: rizzo
Date: Tue Mar 28 08:15:13 2006
New Revision: 15550

URL: http://svn.digium.com/view/asterisk?rev=15550&view=rev
Log:
Use the standard macros to manipulate usecount.
This is in preparation to the import of the new loader.


Modified:
    trunk/res/res_smdi.c

Modified: trunk/res/res_smdi.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_smdi.c?rev=15550&r1=15549&r2=15550&view=diff
==============================================================================
--- trunk/res/res_smdi.c (original)
+++ trunk/res/res_smdi.c Tue Mar 28 08:15:13 2006
@@ -59,8 +59,7 @@
 
 /* Use count stuff */
 
-AST_MUTEX_DEFINE_STATIC(localuser_lock);
-static int localusecnt = 0;
+LOCAL_USER_DECL;
 
 /*! \brief SMDI interface container. */
 struct ast_smdi_interface_container {
@@ -505,10 +504,7 @@
 	ASTOBJ_CONTAINER_DESTROY(&iface->mwi_q);
 	free(iface);
 
-	ast_mutex_lock(&localuser_lock);
-	localusecnt--;
-	ast_mutex_unlock(&localuser_lock);
-	ast_update_use_count();
+	STANDARD_DECREMENT_USECOUNT;
 }
 
 /*!
@@ -692,10 +688,7 @@
 
 			ASTOBJ_CONTAINER_LINK(&smdi_ifaces, iface);
 			ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);
-			ast_mutex_lock(&localuser_lock);
-			localusecnt++;
-			ast_mutex_unlock(&localuser_lock);
-			ast_update_use_count();
+			STANDARD_INCREMENT_USECOUNT;
 		} else {
 			ast_log(LOG_NOTICE, "Ignoring unknown option %s in %s\n", v->name, config_file);
 		}
@@ -747,6 +740,12 @@
 	ASTOBJ_CONTAINER_DESTROYALL(&smdi_ifaces, ast_smdi_interface_destroy);
 	ASTOBJ_CONTAINER_DESTROY(&smdi_ifaces);
 
+	/*
+	 * localusers = NULL; is just to silence the compiler warning
+	 * about an unused variable. It will be removed soon, when the
+	 * LOCALUSER-related functions are rewritten.
+	 */
+	localusers = NULL;
 	return 0;
 }
 



More information about the asterisk-commits mailing list