Hi, [...] I love the whole idea, but gave up working on such a things myself. > > > > Because clang analysis wants it to be global! > > A __protected_by() annotation sounds like a good idea. I don't really > care about the format too much. If the information were in a comment > and we could parse with a perl script that would be fine. Or we could > do: > > struct foo { > struct mutex lock; > __start_protected(lock); > int a, b, c; > __end_protected(lock); > }; Regarding the syntax I vote for a __protected_by(lock) instead of __start_protected(lock) / __end_protected(lock). cheers, Phil