aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_smdi.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-28 14:15:13 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-28 14:15:13 +0000
commite917ce305fd45e605edbe45e0fbf3b8de276be82 (patch)
tree15ba3e06efa5b2bb9304f1f1edcb1ad5ed88e6ce /res/res_smdi.c
parent41615c740e5cda19e422e332d6ea3d59dfd057b8 (diff)
Use the standard macros to manipulate usecount.
This is in preparation to the import of the new loader. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@15550 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_smdi.c')
-rw-r--r--res/res_smdi.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/res/res_smdi.c b/res/res_smdi.c
index e8607ebe1..33bf4a4ec 100644
--- a/res/res_smdi.c
+++ b/res/res_smdi.c
@@ -59,8 +59,7 @@ static int smdi_load(int reload);
/* 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 @@ void ast_smdi_interface_destroy(struct ast_smdi_interface *iface)
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 @@ static int smdi_load(int reload)
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 @@ int unload_module(void)
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;
}