From 99b5beba2f6c3f2e206e6200a05519a0ec2dc8db Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 9 May 2012 14:23:27 -0300 Subject: 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 --- coroutine-sigaltstack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coroutine-sigaltstack.c') 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) { -- cgit v1.2.1