[PATCH] D98747: Thread safety analysis: Don't warn about managed locks on join points

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 25 06:26:09 PDT 2021


aaronpuchert added a comment.

In D98747#2648943 <https://reviews.llvm.org/D98747#2648943>, @aaronpuchert wrote:

> We could probably address all false negatives by introducing a `FactEntry` for "managed locks that might be held", which we introduce on discrepancies at join points. We assume that they're fine for the destructor, but we would warn if there is an explicit lock/unlock. I could start working on this if you think that's a good idea, but it would not only address false negatives introduced in this change, but also false negatives that we've had before.

Hmm, this won't work for back edges, because we can't change the lock set after the join point for them.

But I believe we could warn on back edges if a "managed lock that might be held" joins with a managed lock that is held or not held right away. If there is a path from the loop entry that might acquire or release the lock, then we might run into this same path with our lock that might be held. Might not be easy to place the diagnostics correctly, but otherwise it seems consistent.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98747/new/

https://reviews.llvm.org/D98747



More information about the cfe-commits mailing list