Threads and signals

Ivan Voras ivoras at freebsd.org
Thu Jan 3 13:05:57 PST 2008


Hi,

How do threads interact with signals? In particular, if I have a "main"
process thread (the one started by main()) which generates items for a
mutex-protected queue which are consumed by a worker thread, and I need
to insert an item in the queue from the signal handler, am I correct
that doing pthread_mutex_lock() from the signal handler could deadlock
if the signal handler is executed by any of the threads (and the mutex
is non-recursive)?

How is this solved in general? By recursive mutexes?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20080103/412a359a/signature.pgp


More information about the freebsd-threads mailing list