See discussion at https://bugs.freedesktop.org/show_bug.cgi?id=90303 (We should also try ThreadSanitizer on HarfBuzz some time.)
Created attachment 115603 [details] [review] harfbuzz-atomics.patch Here's something that seems to work for me
Thanks. Are these able to replace pthreads mutex implementation as well?
I'm assuming you mean the bits in hb-mutex-private.hh? I suppose we could write something for HAVE_CXX11_ATOMIC_PRIMITIVES, but I'm not sure it makes a big difference: such a case is only hit on a non-Windows system with threads (but not pthreads) and a GCC-esque compiler...seems like kind of an unusual system. The argument for making the hb-atomic-private.hh changes was to fix hb_atomic_ptr_impl_get so that the atomicity of the load was visible to TSan or similar. There's not an equivalent case here; the interesting accesses are both fully covered by the __sync_* operations.
Makes sense. Thanks. FWIW, I always wondered about the cryptic way the atomic get/set were implemented.
Following up here: https://github.com/behdad/harfbuzz/issues/345
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.