From: Jan Kiszka Date: Wed, 9 May 2012 17:23:27 +0000 (-0300) Subject: coroutine: Fix setup of sigaltstack coroutines X-Git-Tag: qemu-xen-4.3.0-rc1~1081^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=99b5beba2f6c3f2e206e6200a05519a0ec2dc8db;p=qemu-upstream-4.3-testing.git 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 Reviewed-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c index 7ff2d3379..b2e316cea 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) {