Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Jan 2008 22:05:43 +0100
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-threads@freebsd.org
Subject:   Threads and signals
Message-ID:  <fljin9$crb$1@ger.gmane.org>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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?


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHfU4nldnAQVacBcgRAmYaAJ9otYyttlpdgswiBBpjPaLCgxJgEQCdFUpF
tDXHVbYxeYKDtFMn5YZ8kNA=
=ttN4
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fljin9$crb$1>