[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC] main loop: fix some accesses made in sighan
Re: [Qemu-devel] [PATCH RFC] main loop: fix some accesses made in sighandler context
Fri, 16 Sep 2011 09:58:00 +0200
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:184.108.40.206) Gecko/20110817 Fedora/3.1.12-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.12
On 09/15/11 21:44, Peter Maydell wrote:
On 15 September 2011 18:22, Laszlo Ersek<address@hidden> 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.