[compiler-rt] [compiler-rt][builtins] Switch libatomic locks to pthread_mutex_t. (PR #94374)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 10:44:03 PDT 2024


MaskRay wrote:

LGTM. It's perhaps worth mentioning that GCC libatomic also uses pthread_mutex_t. So this change would bring three advantages:

* The uninstrumented atomic.c will work seemlessly with tsan (thanks to the pthread_mutex_lock interceptor). We don't need a separate tsan version of libatomic
* It would prevent potential issues with high thread competition for the spin lock.
* It aligns with GCC libatomic.

https://github.com/llvm/llvm-project/pull/94374


More information about the llvm-commits mailing list