This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Program hung when delete threads and exit

Hi,

The program will hung sometimes just before calling Vsys_exit() or after calling it. I use strace to see what's happened and found that 13 threads are blocked. The messages are below. It seems that dead lock occured somewhere. I also find that before Vsys_exit() is called there will be 13 threads left just the same as the number of threads that blocked. 

In the program, only the OSA APIs use pthread_mutex_lock and pthread_mutex_unlock. I don't know if these APIs make dead lock. Could someone know that?

Thanks in advance!

553 19:01:44.223803 futex(0x75d44, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
552 19:01:44.224142 futex(0x105ae4, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
551 19:01:44.224225 futex(0xfce9c, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
550 19:01:44.224297 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
549 19:01:44.224369 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
548 19:01:44.224438 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
547 19:01:44.224508 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
546 19:01:44.224578 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
545 19:01:44.224649 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
544 19:01:44.224720 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
543 19:01:44.224791 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
542 19:01:44.224865 read(11, <unfinished ...>
541 19:01:44.224970 futex(0xad6d0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
551 19:01:44.239533 <... futex resumed> ) = ? ERESTARTSYS (To be restarted) <0.015264>
551 19:01:44.239609 --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
551 19:01:44.240002 sigreturn() = ? (mask now []) <0.000025>
551 19:01:44.240246 futex(0xfce9c, FUTEX_WAIT_PRIVATE, 1, NULL) = ? ERESTARTSYS (To be restarted) <0.039243>
551 19:01:44.279603 --- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
551 19:01:44.279869 sigreturn() = ? (mask now []) <0.000023>

......