libstdc++ and race detectors

Jonathan Wakely jwakely.gcc@gmail.com
Tue Jul 13 23:21:00 GMT 2010


On 13 July 2010 16:14, Kostya Serebryany wrote:
> Index: include/bits/basic_string.h
> ===================================================================
> --- include/bits/basic_string.h (revision 162071)
> +++ include/bits/basic_string.h (working copy)
> @@ -232,8 +232,7 @@
>  #ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
>          if (__builtin_expect(this != &_S_empty_rep(), false))
>  #endif
> -           if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
> -                                                      -1) <= 0)
> +            if
> (__gnu_cxx::__decrement_reference_count(&this->_M_refcount) <= 0)
>              _M_destroy(__a);
>        }  // XXX MT

Can the macros be put directly here?  Is a new function needed?



More information about the Libstdc++ mailing list