mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
Use the standard macros to manipulate usecount.
This is in preparation to the import of the new loader. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -59,8 +59,7 @@ static int smdi_load(int reload);
|
|||||||
|
|
||||||
/* Use count stuff */
|
/* Use count stuff */
|
||||||
|
|
||||||
AST_MUTEX_DEFINE_STATIC(localuser_lock);
|
LOCAL_USER_DECL;
|
||||||
static int localusecnt = 0;
|
|
||||||
|
|
||||||
/*! \brief SMDI interface container. */
|
/*! \brief SMDI interface container. */
|
||||||
struct ast_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);
|
ASTOBJ_CONTAINER_DESTROY(&iface->mwi_q);
|
||||||
free(iface);
|
free(iface);
|
||||||
|
|
||||||
ast_mutex_lock(&localuser_lock);
|
STANDARD_DECREMENT_USECOUNT;
|
||||||
localusecnt--;
|
|
||||||
ast_mutex_unlock(&localuser_lock);
|
|
||||||
ast_update_use_count();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -692,10 +688,7 @@ static int smdi_load(int reload)
|
|||||||
|
|
||||||
ASTOBJ_CONTAINER_LINK(&smdi_ifaces, iface);
|
ASTOBJ_CONTAINER_LINK(&smdi_ifaces, iface);
|
||||||
ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);
|
ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);
|
||||||
ast_mutex_lock(&localuser_lock);
|
STANDARD_INCREMENT_USECOUNT;
|
||||||
localusecnt++;
|
|
||||||
ast_mutex_unlock(&localuser_lock);
|
|
||||||
ast_update_use_count();
|
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_NOTICE, "Ignoring unknown option %s in %s\n", v->name, config_file);
|
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_DESTROYALL(&smdi_ifaces, ast_smdi_interface_destroy);
|
||||||
ASTOBJ_CONTAINER_DESTROY(&smdi_ifaces);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user