This commit is separated from #19238, and it adds support of Negative Capabilities in the Clang Thread Safety Analysis attributes.
Negative requirements are an alternative
EXCLUDES
[LOCKS_EXCLUDED
] that provide a stronger safety guarantee. A negative requirement uses theREQUIRES
[EXCLUSIVE_LOCKS_REQUIRED
] attribute, in conjunction with the ! operator, to indicate that a capability should not be held.
Examples of usage:
- #19238 (for a class)
- https://github.com/hebasto/bitcoin/tree/200610-addrman-tsn (for the whole code base)