mirror-llvm-project/libcxx/include/__mutex
AnthonyCalandraGeotab 72e1037c32
[libc++][ThreadSafety] Add thread safety annotations for variadic std::scoped_lock (#204462)
The thread safety annotations on std::scoped_lock were previously only
applied to the empty and single-mutex specializations. The general
variadic specialization carried no annotations, so -Wthread-safety
considered none of the mutexes held inside a multi-mutex scoped_lock
block and reported the guarded data accessed there as unprotected.

Now that Clang supports pack expansion inside thread safety attributes
(landed for Clang 21), annotate the variadic scoped_lock with
acquire_capability/requires_capability on its constructors,
release_capability on its destructor, and scoped_lockable on the class.

Fixes #42000.

Co-authored-by: Anthony Calandra <anthony@anthony-calandra.com>
2026-07-07 17:52:56 +02:00
..
lock_guard.h [libc++][ThreadSafety] Add thread safety annotations for variadic std::scoped_lock (#204462) 2026-07-07 17:52:56 +02:00
mutex.h [libc++][ThreadSafety] Add thread safety annotations for variadic std::scoped_lock (#204462) 2026-07-07 17:52:56 +02:00
once_flag.h [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
tag_types.h
unique_lock.h [libc++] Apply [[nodiscard]] to unique_lock and <shared_mutex> (#200986) 2026-06-02 21:00:56 +08:00