This is the mail archive of the
mailing list for the GCC project.
Re: Make generic atomicity.h use gthr.h mutexes
- From: Phil Edwards <phil at jaj dot com>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Sun, 10 Nov 2002 18:11:24 -0500
- Subject: Re: Make generic atomicity.h use gthr.h mutexes
- References: <200211102017.gAAKHsUT004444@hiauly1.hia.nrc.ca>
On Sun, Nov 10, 2002 at 03:17:54PM -0500, John David Anglin wrote:
> __initialized is local to the each inline copy of __exchange_and_add,
> so each copy will attempt to initialize _Atomic_add_mutex. Even if
> __initialized was global, there could be race conditions in initializing
Yargh, of course. Okay, if __initialized is moved to something like
__gthread_mutex_t _Atomic_add_mutex __attribute__ ((__weak__))
bool _Atomic_add_mutex_initialized __attribute__ ((__weak__)) = false
and the if branch remains, that should do it.
I'm not fond of the semicolon games played above, and will cheerfully be more
verbose if people prefer.
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002