Skip to content

Commit 143551a

Browse files
authored
[clang-tidy][NFC] Fix error in example code for modernize-use-scoped-lock's doc (#159722)
1 parent a2dcc88 commit 143551a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Multiple ``std::lock_guard`` declarations only emit warnings:
5151

5252
std::mutex M1, M2;
5353
std::lock(M1, M2);
54-
std::lock_guard Lock1(M, std::adopt_lock); // warning: use single 'std::scoped_lock' instead of multiple 'std::lock_guard'
55-
std::lock_guard Lock2(M, std::adopt_lock); // note: additional 'std::lock_guard' declared here
54+
std::lock_guard Lock1(M1, std::adopt_lock); // warning: use single 'std::scoped_lock' instead of multiple 'std::lock_guard'
55+
std::lock_guard Lock2(M2, std::adopt_lock); // note: additional 'std::lock_guard' declared here
5656

5757

5858
Limitations

0 commit comments

Comments
 (0)