Received: from eggs.gnu.org ([208.118.235.92]:35897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSAby-0008Oh-Rl for qemu-devel@nongnu.org; Wed, 09 May 2012 13:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSAbu-0004sL-0t for qemu-devel@nongnu.org; Wed, 09 May 2012 13:23:38 -0400 Received: from thoth.sbs.de ([192.35.17.2]:16890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSAbt-0004os-NT for qemu-devel@nongnu.org; Wed, 09 May 2012 13:23:33 -0400 Message-ID: <4FAAA80F.1060806@siemens.com> Date: Wed, 09 May 2012 14:23:27 -0300 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 1.1] coroutine: Fix setup of sigaltstack coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel 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 --- 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.3.4