Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No thread-safe annotations for mutex and related classes #4555

Open
JVApen opened this issue Apr 2, 2024 · 3 comments
Open

No thread-safe annotations for mutex and related classes #4555

JVApen opened this issue Apr 2, 2024 · 3 comments
Labels
enhancement Something can be improved

Comments

@JVApen
Copy link

JVApen commented Apr 2, 2024

The clang compiler comes with some very useful warnings under the umbrella of -Wthread-safety. (See https://clang.llvm.org/docs/ThreadSafetyAnalysis.html) Unfortunately, the MS STL does not provide annotations to the relevant classes, such that this warning cannot be used with the standard STL types.

How about other implementations?

Would it be possible to decorate the thread safety analysis such that this warning can be used and prevent a lot of debugging time for threading issues that are easily caught by the compiler?

@JVApen JVApen added the question Further information is requested label Apr 2, 2024
@frederick-vs-ja
Copy link
Contributor

This looks like duplicate of #3163.

It's a unfortunate that annotations in SAL for concurrency isn't designed for C++ lock types (#3536 (comment)).

But it seems possible to me to add annotations for Clang.

@JVApen
Copy link
Author

JVApen commented Apr 2, 2024

Looks indeed like a duplicate of #3163

@StephanTLavavej StephanTLavavej added enhancement Something can be improved and removed question Further information is requested labels Apr 3, 2024
@StephanTLavavej
Copy link
Member

Thanks! We'll use this newer issue as the primary since it talks only about Clang (and not SAL annotations which we've abandoned any attempt to use here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

No branches or pull requests

3 participants