Hi, all:<br><br>     Asterisk1.2.10,  in pbx.c, the ast_custom_function_register is<br><br>int ast_custom_function_register(struct ast_custom_function *acf) <br>{<br>    if (!acf)<br>        return -1;<br><br>    /* try to lock functions list ... */
<br>    if (ast_mutex_lock(&acflock)) {<br>        ast_log(LOG_ERROR, "Unable to lock function list. Failed registering function %s\n", acf->name);<br>        return -1;<br>    }<br><br>    if (ast_custom_function_find(acf->name)) {
<br>        ast_log(LOG_ERROR, "Function %s already registered.\n", acf->name);<br>        ast_mutex_unlock(&acflock);<br>        return -1;<br>   }<br>   /* ......... */<br>}<br><br>struct ast_custom_function* ast_custom_function_find(char *name) 
<br>{<br>    struct ast_custom_function *acfptr;<br><br>    /* try to lock functions list ... */<br>    if (ast_mutex_lock(&acflock)) {<br>        ast_log(LOG_ERROR, "Unable to lock function list\n");<br>        return NULL;
<br>    }<br>   /* ....... */<br>}<br><br>The mutex acflock is locked twice,  so, the process will be deadlock here, but it's not in fact.<br>Why? Is there something that I missed?<br><br>