Asterisk1.2.10, in pbx.c, the ast_custom_function_register is
int ast_custom_function_register(struct ast_custom_function *acf)
{
if (!acf)
return -1;
/* try to lock functions list ... */
if (ast_mutex_lock(&acflock)) {
ast_log(LOG_ERROR, "Unable to lock function list. Failed registering function %s\n", acf->name);
return -1;
}
if (ast_custom_function_find(acf->name)) {
ast_log(LOG_ERROR, "Function %s already registered.\n", acf->name);
ast_mutex_unlock(&acflock);
return -1;
}
/* ......... */
}
struct ast_custom_function* ast_custom_function_find(char *name)
{
struct ast_custom_function *acfptr;
/* try to lock functions list ... */
if (ast_mutex_lock(&acflock)) {
ast_log(LOG_ERROR, "Unable to lock function list\n");
return NULL;
}
/* ....... */
}
The mutex acflock is locked twice, so, the process will be deadlock here, but it's not in fact.
Why? Is there something that I missed?
_______________________________________________ --Bandwidth and Colocation provided by Easynews.com --
asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
