The next import of WebRTC.org code will include GUARDED_BY(a_critical_section) annotations. (on clang, devolves to __attribute__(guarded_by(a_critical_section)) ) This is derived from https://code.google.com/p/gperftools/source/browse/src/base/thread_annotations.h and modified in webrtc.org for clang (from GCC), so likely we could have it do both. In the webrtc.org codebase, it's in webrtc/base/thread_annotations.h: https://code.google.com/p/webrtc/source/browse/trunk/webrtc/base/thread_annotations.h This would likely allow better analysis ala tsan and be better (and more maintainable) than 10 million AssertCurrentThreadOwns()s in the source.
I remember seeing something along these lines in a patch, that added macros annotating things for valgrind purposes (or its thread-safety-checking sub-variant). Not sure if it landed or not, and I can't find it in open mfbt bugs right now, and I don't remember names well enough to search for it. (But said names closely paralleled valgrind macro name concepts, so that'd be the way to search to find it, I think.)
You need to log in before you can comment on or make changes to this bug.