bug 22836 : atomics in shared_ptr (ThreadSanitizer)

Oleg Smolsky oleg at smolsky.net
Wed Mar 11 08:38:01 PDT 2015


On 2015-03-10 15:31, Howard Hinnant wrote:
> On Mar 7, 2015, at 11:06 PM, Oleg Smolsky <oleg at smolsky.net> wrote:
>
>> Hi there, I reported a TSan issue that resulted in the following bug report against libc++:
>>      http://llvm.org/bugs/show_bug.cgi?id=22836
>>
>> Could you folks take a look at the following (intuitive) patch please?
>>      http://reviews.llvm.org/D8147
>>
>> Thanks!
>> Oleg.
> Can the increment be relaxed?
>
> http://stackoverflow.com/q/28199212/576911
>
>
Hi Howard, my understanding is that the increment path can become:

     __shared_owners_.fetch_add(1, std::memory_order_acquire);

BTW, does that make any difference on x86-64?

Oleg.



More information about the cfe-commits mailing list