From: Jan Kiszka <jan.kiszka@siemens.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 1.1] coroutine: Fix setup of sigaltstack coroutines
Date: Wed, 09 May 2012 14:23:27 -0300 [thread overview]
Message-ID: <4FAAA80F.1060806@siemens.com> (raw)
Use pthread_kill instead of process-wide kill to invoke the signal
handler used for stack switching. This may fix spurious lock-ups with
this backend, easily triggerable by extending the time window between
kill and sigsuspend.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
coroutine-sigaltstack.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c
index 7ff2d33..b2e316c 100644
--- a/coroutine-sigaltstack.c
+++ b/coroutine-sigaltstack.c
@@ -226,7 +226,7 @@ static Coroutine *coroutine_new(void)
* called.
*/
coTS->tr_called = 0;
- kill(getpid(), SIGUSR2);
+ pthread_kill(pthread_self(), SIGUSR2);
sigfillset(&sigs);
sigdelset(&sigs, SIGUSR2);
while (!coTS->tr_called) {
--
1.7.3.4
next reply other threads:[~2012-05-09 17:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 17:23 Jan Kiszka [this message]
2012-05-10 7:29 ` [Qemu-devel] [PATCH 1.1] coroutine: Fix setup of sigaltstack coroutines Paolo Bonzini
2012-05-10 8:07 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAAA80F.1060806@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).