We are extensively using our own custom synchronization C functions and C++ classes like C-wrapped asm instructions for atomic access, memory order control, C++ templated ring buffers, double buffers, rendezvous points and more. We are using them due to hard real-time constraints of our applications and for performance reasons.
Now if I understand it correctly, the Thread Sanitizer cannot cope with custom synchronization out of the box, and would generate false positives due to that. Is that correct? And if so, is there any way to make our custom synchronization code work hand in hand with the Thread Sanitizer? For example are there i.e. stub lock and unlock calls in the sanitizer lib, pragmas or anything else that would allows our custom synchronization code to tell the sanitizer that the respective memory has now been locked/unlocked by us?