bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Deadlock (pthread) in signal handler


From: Low Sze Hau
Subject: Deadlock (pthread) in signal handler
Date: Thu, 28 Apr 2005 09:49:10 +0800

For your information, I am using

Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

When a process is interrupted by a signal, a mutex lock (eg. when calling
free(), malloc() or other C functions) might be already acquired after the
interruption. Therefore, when the program calls a C function
(malloc()), the program goes
into a race condition and is waiting for a mutex to be unlocked. My
questions are:

1. Is there any way to check whether there is a mutex was already locked (for
the above case, malloc() or free()) in the program's signal handler?
or any compiler option that I can apply to avoid the deadlock?



Thanks
Low Sze Hau




reply via email to

[Prev in Thread] Current Thread [Next in Thread]