From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STxRv-0005XW-Rj for qemu-devel@nongnu.org; Mon, 14 May 2012 11:44:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1STxRq-0000Et-Rr for qemu-devel@nongnu.org; Mon, 14 May 2012 11:44:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STxRq-0000EW-JP for qemu-devel@nongnu.org; Mon, 14 May 2012 11:44:34 -0400 From: Kevin Wolf Date: Mon, 14 May 2012 17:44:15 +0200 Message-Id: <1337010257-9324-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1337010257-9324-1-git-send-email-kwolf@redhat.com> References: <1337010257-9324-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] coroutine: Fix setup of sigaltstack coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Jan Kiszka 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 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