From: Freddie Chopin <freddie_chopin@op.pl>
To: newlib@sourceware.org
Subject: Re: [PATCH 2/3, newlib] Only define static locks in multithreaded mode
Date: Wed, 01 Feb 2017 08:49:00 -0000 [thread overview]
Message-ID: <1485938923.1269.3.camel@op.pl> (raw)
In-Reply-To: <7a943313-48e7-2c8f-7250-ce47aeecda13@foss.arm.com>
On Tue, 2017-01-31 at 17:10 +0000, Thomas Preudhomme wrote:
> It also makes sure locking macros in lock.h are noop in single thread
> mode.
Doesn't it make all the guards in the code superfluous? If the lock
initialization macros are defined to be ";" and lock functions are
defined to be "(void)0", then the guards in the code actually guard
nothing, as things like:
#if !defined(__SINGLE_THREAD__) && defined(HAVE_DD_LOCK)
 __LOCK_INIT(static, __dd_hash_mutex);
 #endif
#ifndef __SINGLE_THREAD__
        __lock_acquire(__dd_hash_mutex);
 #endif
will then be equivalent to:
#if !defined(__SINGLE_THREAD__) && defined(HAVE_DD_LOCK)
 ;
 #endif
#ifndef __SINGLE_THREAD__
        (void)0;
 #endif
Regards,
FCh
next prev parent reply other threads:[~2017-02-01 8:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 17:10 Thomas Preudhomme
2017-01-31 17:21 ` Thomas Preudhomme
2017-02-10 11:12 ` Thomas Preudhomme
2017-02-13 22:16 ` Jeff Johnston
2017-02-01 8:49 ` Freddie Chopin [this message]
2017-02-02 14:32 ` Thomas Preudhomme
2017-02-02 15:46 ` Craig Howland
2017-02-03 9:01 ` Thomas Preudhomme
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485938923.1269.3.camel@op.pl \
--to=freddie_chopin@op.pl \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).