Force use of locks inside std::atomic during debugging with libstdc++
问题 I've done a bit of a google and can't seem to turn up a GCC option or libstdc++ macro for this. Is it possible to force the use of locking internally on all the std::atomic template specializations. On some platforms some of the specializations are locking anyway, so it certainly seems like a feasible option. In the past I've found the use of std::atomic to be very painful when debugging data-races with tools such as Valgrind ( Helgrind or DRD ) due to the enormous number of false positives.