bug-gplusplus
[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: Wed, 27 Apr 2005 10:44:05 +0800

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, the program goes into a race condition and is waiting for a
mutex to be unlock. My questions are:

1. Is this a bug in g++?
2. Is there any way to check whether there is a mutex was already
locked in the program's signal handler? or any compler option that I
can apply to avoid the deadlock?


For your information, I am using

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


Thanks
Low Sze Hau




reply via email to

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