Re: [PATCH] PR libstdc++/91057 set locale::id::_M_index atomically

2019-10-10 Thread Jonathan Wakely
On 09/10/19 16:59 +0100, Jonathan Wakely wrote: If two threads see _M_index==0 concurrently they will both try to set it, potentially storing the facet at two different indices in the array. Either set the _M_index data member using an atomic compare-exchange operation or while holding a mutex.

[PATCH] PR libstdc++/91057 set locale::id::_M_index atomically

2019-10-09 Thread Jonathan Wakely
If two threads see _M_index==0 concurrently they will both try to set it, potentially storing the facet at two different indices in the array. Either set the _M_index data member using an atomic compare-exchange operation or while holding a mutex. Also move the LONG_DOUBLE_COMPAT code into a sep