[PATCH] D51187: [RFC] Thread safety analysis: Track status of scoped capability

Delesley Hutchins via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 21 15:44:34 PDT 2018


delesley added a comment.

In https://reviews.llvm.org/D51187#1241354, @aaronpuchert wrote:

> Thanks for pointing out my error! Ignoring the implementation for a moment, do you think this is a good idea or will it produce too many false positives? Releasable/relockable scoped capabilities that I have seen keep track of the status, so it makes sense, but maybe there are others out there.


I think this is probably a good idea.  Code which manipulates the underlying mutex while it is being managed by another object is a recipe for trouble.  It's hard for me to guess how many false positives it will generate without actually running it over our code base, which I personally don't have time to do right now.  It should definitely go in -Wthread-safety-beta so it won't break the build.  Unfortunately, the before/after checks are still in thread-safety-beta, and they should really be moved out of beta before something else is moved in.  The good news is that Matthew O'Niel just volunteered to do that.  That is, unfortunately, not a trivial operation, so it may be some weeks before he's done.


Repository:
  rC Clang

https://reviews.llvm.org/D51187





More information about the cfe-commits mailing list