[PATCH] D49355: Thread safety analysis: Allow lock upgrading and downgrading

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 4 03:23:58 PDT 2018

aaronpuchert added a comment.

Could you explain what annotations like `LOCK_UNLOCK` are useful for? What do they check? The annotation should certainly not be necessary.

Shouldn't you just use `REQUIRES(!...)` or `EXCLUDES(...)`? If a function locks and unlocks a mutex, I don't see a reason to have annotations on it, other than for preventing double locks. But for that we have negative capabilities.

  rC Clang


More information about the cfe-commits mailing list