Thread safety analysis: Improve documentation for scoped capabilities
authorAaron Puchert <aaronpuchert@alice-dsl.net>
Sun, 6 Sep 2020 18:35:02 +0000 (20:35 +0200)
committerAaron Puchert <aaronpuchert@alice-dsl.net>
Sun, 6 Sep 2020 18:37:42 +0000 (20:37 +0200)
commitbbb3baf6205c54231257f64fd18661a13a5c97ee
treec9c718ba1e2fcef87df590e585f4a1b51402bddb
parentcc6713a2c35edf17cfb567284cc76b374308e5e4
Thread safety analysis: Improve documentation for scoped capabilities

They are for more powerful than the current documentation implies, this
adds

* adopting a lock,
* deferring a lock,
* manually unlocking the scoped capability,
* relocking the scoped capability, possibly in a different mode,
* try-relocking the scoped capability.

Also there is now a generic explanation how attributes on scoped
capabilities work. There has been confusion in the past about how to
annotate them (see e.g. PR33504), hopefully this clears things up.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D87066
clang/docs/ThreadSafetyAnalysis.rst