Modify rule S5997: add diff view and documentation link

This commit is contained in:
Amelie Renard 2023-10-02 15:18:57 +02:00 committed by Amélie Renard
parent 5a6cd5b046
commit 921d6b0a2c

View File

@ -5,7 +5,7 @@
=== Noncompliant code example
[source,cpp]
[source,cpp,diff-id=1,diff-type=noncompliant]
----
void f1(std::mutex &m1) {
std::lock_guard lock{m1}; // Noncompliant
@ -23,7 +23,7 @@ void f2(std::mutex &m1, std::mutex &m2)
=== Compliant solution
[source,cpp]
[source,cpp,diff-id=1,diff-type=compliant]
----
void f1(std::mutex &m1) {
std::scoped_lock lock{m1}; // Compliant
@ -36,6 +36,9 @@ void f2(std::mutex &m1, std::mutex &m2)
}
----
== Resources
* {cpp} reference - https://en.cppreference.com/w/cpp/thread/scoped_lock[std::scoped_lock]
ifdef::env-github,rspecator-view[]