From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSNon-0002Fz-Q0 for qemu-devel@nongnu.org; Thu, 10 May 2012 03:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSNoi-0004la-QS for qemu-devel@nongnu.org; Thu, 10 May 2012 03:29:45 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:33441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSNoi-0004l9-Hn for qemu-devel@nongnu.org; Thu, 10 May 2012 03:29:40 -0400 Received: by pbbro12 with SMTP id ro12so2083978pbb.4 for ; Thu, 10 May 2012 00:29:38 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FAB6E5B.9040101@redhat.com> Date: Thu, 10 May 2012 09:29:31 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4FAAA80F.1060806@siemens.com> In-Reply-To: <4FAAA80F.1060806@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1] coroutine: Fix setup of sigaltstack coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Kevin Wolf , qemu-devel Il 09/05/2012 19:23, Jan Kiszka ha scritto: > 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) { Reviewed-by: Paolo Bonzini