From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4TI6-0002mt-Bv for qemu-devel@nongnu.org; Fri, 16 Sep 2011 03:56:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4TI2-0004vc-AL for qemu-devel@nongnu.org; Fri, 16 Sep 2011 03:56:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4TI2-0004vU-1z for qemu-devel@nongnu.org; Fri, 16 Sep 2011 03:56:50 -0400 Message-ID: <4E730188.7090103@redhat.com> Date: Fri, 16 Sep 2011 09:58:00 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1316107350-31172-1-git-send-email-lersek@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC] main loop: fix some accesses made in sighandler context List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On 09/15/11 21:44, Peter Maydell wrote: > On 15 September 2011 18:22, Laszlo Ersek wrote: >> -int no_shutdown = 0; >> +volatile int no_shutdown = 0; > > So why 'volatile' and not 'sig_atomic_t', then? The sigaction() spec says"volatile sig_atomic_t", so that would be ideal. My assumption was that "sig_atomic_t" (which is allowed by POSIX not to be wider than "char") would be in practice at least as wide as "int" and "pid_t". Should my assumption be wrong on some platforms, qualifying the variables "volatile" while keeping their current types (int / pid_t) does less damage (no damage) than narrowing their types. lacos