[asterisk-dev] problem with mutex

Russell Bryant russell at digium.com
Thu Dec 14 10:45:54 MST 2006


Garavaglia Fabio wrote:
>> There is nothing in this backtrace that suggests the problem you are 
>> seeing has anything to do with a mutex.  This thread is blocking on a 
>> call to poll(), which was probably passed a negative timeout value, 
>> which sets the timeout to infinite.
> yes, in fact:
> static void *listener(void *unused)
> {
>        struct sockaddr_un sunaddr;
>        int s;
>        socklen_t len;
>        int x;
>        int flags;
>        struct pollfd fds[1];
>        pthread_attr_t attr;
>        pthread_attr_init(&attr);
>        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
>        for(;;) {
>                if (ast_socket < 0)
>                        return NULL;
>                fds[0].fd = ast_socket;
>                fds[0].events= POLLIN;
>                s = poll(fds, 1, -1);
> so i think that the lockout is caused by a mutex problem.

No, there are no mutexes involved here.

> i didn't modified this function,so what can i do?what is the problem?

In that case, you're not looking at the right thing in gdb.  The listener 
function runs in its own thread, so it will not be holding up the rest of 
asterisk startup.  The backtrace you see is completely normal.

You will need to look at the other threads that are running to figure out which 
one is causing you a problem.  The command you should use in gdb is "thread 
apply all bt".

-- 
Russell Bryant
Software Engineer
Digium, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: russell.vcf
Type: text/x-vcard
Size: 266 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20061214/34f65dfe/russell.vcf


More information about the asterisk-dev mailing list