mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
Merge "Core/PBX: Deadlock between dialplan execution and application unregistration." into 13
This commit is contained in:
@@ -396,6 +396,11 @@ int ast_unregister_application(const char *app)
|
|||||||
struct ast_app *cur;
|
struct ast_app *cur;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
|
/* Anticipate need for conlock in unreference_cached_app(), in order to avoid
|
||||||
|
* possible deadlock with pbx_extension_helper()/pbx_findapp()
|
||||||
|
*/
|
||||||
|
ast_rdlock_contexts();
|
||||||
|
|
||||||
AST_RWLIST_WRLOCK(&apps);
|
AST_RWLIST_WRLOCK(&apps);
|
||||||
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&apps, cur, list) {
|
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&apps, cur, list) {
|
||||||
cmp = strcasecmp(app, cur->name);
|
cmp = strcasecmp(app, cur->name);
|
||||||
@@ -418,6 +423,8 @@ int ast_unregister_application(const char *app)
|
|||||||
AST_RWLIST_TRAVERSE_SAFE_END;
|
AST_RWLIST_TRAVERSE_SAFE_END;
|
||||||
AST_RWLIST_UNLOCK(&apps);
|
AST_RWLIST_UNLOCK(&apps);
|
||||||
|
|
||||||
|
ast_unlock_contexts();
|
||||||
|
|
||||||
return cur ? 0 : -1;
|
return cur ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user