qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/3] coroutine: Fix setup of sigaltstack coroutines


From: Kevin Wolf
Subject: [Qemu-devel] [PATCH 1/3] coroutine: Fix setup of sigaltstack coroutines
Date: Mon, 14 May 2012 17:44:15 +0200

From: Jan Kiszka <address@hidden>

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 <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 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.6.5




reply via email to

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