summary refs log tree commit diff stats
path: root/coroutine-sigaltstack.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-05-09 14:23:27 -0300
committerKevin Wolf <kwolf@redhat.com>2012-05-14 17:02:19 +0200
commit99b5beba2f6c3f2e206e6200a05519a0ec2dc8db (patch)
treee8d4db8a0db39878002e74fe3b5689ff2419b2ea /coroutine-sigaltstack.c
parent77f4c9a68aedb9b0d290a1def1bfc8714be862ec (diff)
downloadfocaccia-qemu-99b5beba2f6c3f2e206e6200a05519a0ec2dc8db.tar.gz
focaccia-qemu-99b5beba2f6c3f2e206e6200a05519a0ec2dc8db.zip
coroutine: Fix setup of sigaltstack coroutines
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>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'coroutine-sigaltstack.c')
-rw-r--r--coroutine-sigaltstack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c
index 7ff2d3379e..b2e316cea2 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) {