<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I'm looking to find and document the best ways to use clang
thread-safety features (capability analysis), especially for some
common patterns of access such as a single reader/writer thread
with multiple reader threads, and also to document how to use it
for thread-locked access checking -- there's a single example
involving a ThreadRole.h file to set up uses of capabilities for
tracking threads. There's a brief mention of it on the paper,
and also a longer example at
<a class="moz-txt-link-freetext" href="https://insights.sei.cmu.edu/blog/thread-safety-analysis-in-c-and-c/">https://insights.sei.cmu.edu/blog/thread-safety-analysis-in-c-and-c/</a>
. However, that's from 2014, and it doesn't cover a lot of
possible uses.</p>
<p>One way to possibly handle the reader/writer vs readers case
(where reads on the writing thread don't need to lock) would be to
be able to say "guarded by this or that", in this case something
like GUARDED_BY(mMutex, MainThread) (GUARDED_BY(mMutex ||
MainThread) ??).</p>
<p> Randell Jesup, Mozilla<br>
</p>
</body>
</html>