mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
- Add Tilghman to the copyright info ... he wrote the hard part :)
- Remove some magic in unload_module that isn't needed. Module use counts already ensure that the function isn't going to be in use at this point. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2008, Digium, Inc.
|
* Copyright (C) 2008, Digium, Inc.
|
||||||
*
|
*
|
||||||
* Russell Bryant <russell@digium.com>
|
* Russell Bryant <russell@digium.com>
|
||||||
|
* Tilghman Lesher <func_config__200803@the-tilghman.com>
|
||||||
*
|
*
|
||||||
* See http://www.asterisk.org for more information about
|
* See http://www.asterisk.org for more information about
|
||||||
* the Asterisk project. Please do not directly contact
|
* the Asterisk project. Please do not directly contact
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
* \brief A function to retrieve variables from an Asterisk configuration file
|
* \brief A function to retrieve variables from an Asterisk configuration file
|
||||||
*
|
*
|
||||||
* \author Russell Bryant <russell@digium.com>
|
* \author Russell Bryant <russell@digium.com>
|
||||||
|
* \author Tilghman Lesher <func_config__200803@the-tilghman.com>
|
||||||
*
|
*
|
||||||
* \ingroup functions
|
* \ingroup functions
|
||||||
*/
|
*/
|
||||||
@@ -170,20 +172,13 @@ static int unload_module(void)
|
|||||||
struct config_item *cur;
|
struct config_item *cur;
|
||||||
int res = ast_custom_function_unregister(&config_function);
|
int res = ast_custom_function_unregister(&config_function);
|
||||||
|
|
||||||
/* Allow anything already in the routine to exit */
|
|
||||||
usleep(1);
|
|
||||||
AST_RWLIST_WRLOCK(&configs);
|
AST_RWLIST_WRLOCK(&configs);
|
||||||
usleep(1);
|
|
||||||
AST_RWLIST_UNLOCK(&configs);
|
|
||||||
/* Even if it needed to upgrade a lock */
|
|
||||||
usleep(1);
|
|
||||||
AST_RWLIST_WRLOCK(&configs);
|
|
||||||
/* At this point, no other thread should be queued inside this module */
|
|
||||||
while ((cur = AST_RWLIST_REMOVE_HEAD(&configs, entry))) {
|
while ((cur = AST_RWLIST_REMOVE_HEAD(&configs, entry))) {
|
||||||
ast_config_destroy(cur->cfg);
|
ast_config_destroy(cur->cfg);
|
||||||
ast_free(cur);
|
ast_free(cur);
|
||||||
}
|
}
|
||||||
AST_RWLIST_UNLOCK(&configs);
|
AST_RWLIST_UNLOCK(&configs);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user