From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoe4D-0007Kz-As for qemu-devel@nongnu.org; Fri, 08 Apr 2016 17:35:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoe49-0008BP-9l for qemu-devel@nongnu.org; Fri, 08 Apr 2016 17:35:49 -0400 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:33088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoe49-0008B3-2v for qemu-devel@nongnu.org; Fri, 08 Apr 2016 17:35:45 -0400 Received: by mail-lf0-x236.google.com with SMTP id e190so90534653lfe.0 for ; Fri, 08 Apr 2016 14:35:44 -0700 (PDT) References: <1460050358-25025-1-git-send-email-cota@braap.org> <1460050358-25025-7-git-send-email-cota@braap.org> <87bn5kb6ek.fsf@linaro.org> <5707FA93.9090803@twiddle.net> <87a8l3bxpc.fsf@linaro.org> <570821FD.2010107@redhat.com> <57082326.4050604@twiddle.net> From: Sergey Fedorov Message-ID: <5708242E.20409@gmail.com> Date: Sat, 9 Apr 2016 00:35:42 +0300 MIME-Version: 1.0 In-Reply-To: <57082326.4050604@twiddle.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: "Emilio G. Cota" , QEMU Developers , MTTCG Devel , Peter Crosthwaite , Peter Maydell On 09/04/16 00:31, Richard Henderson wrote: > On 04/08/2016 02:26 PM, Paolo Bonzini wrote: >> >> On 08/04/2016 23:24, Alex Bennée wrote: >>>> Except that quite a lot of hosts can only (efficiently) do atomic operations on >>>> a minimum of 4 byte quantities. I'd rather continue to use int here. >>> I suspect bool == unsigned int underneath. But having true/false and 0/1 mixed up >>> gets confusing even if they are equivalent. >> Sometimes sizeof(bool) == 1. > sizeof(bool) == 1 everywhere except MacOSX, where it's 4. > Hm, that's too strange: $ gcc a.c a.c: In function ‘main’: a.c:6:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] printf("%d\n", sizeof(bool)); ^ $ ./a.out 1 Kind regards, Sergey