Annotate scoped_lock as with scoped_lockable attribute
Summary:
Scoped capabilities need to be annotated as such, otherwise the thread
safety analysis won't work as intended.
Fixes PR39234.
Reviewers: ldionne
Reviewed By: ldionne
Subscribers: christof, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53049
llvm-svn: 344096
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 7f208f02dbea6225db15dbdbf0e8d4778cc36fc5
diff --git a/include/mutex b/include/mutex
index 9c55c7c..6d2de2b 100644
--- a/include/mutex
+++ b/include/mutex
@@ -489,7 +489,7 @@
};
template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS scoped_lock<_Mutex> {
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable) scoped_lock<_Mutex> {
public:
typedef _Mutex mutex_type;
private: