Skip to content

Commit 46e6942

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2396 from JordanMaples/patch-19
Add C++ Core Guidelines link to C26441
2 parents 46b0857 + f9381a4 commit 46e6942

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/code-quality/c26441.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: f923c422-ed01-4644-b40b-93f15fc5bb93
1212
"Guard objects must be named."
1313

1414
**C++ Core Guidelines**:
15-
CP.44: Remember to name your lock_guards and unique_locks
15+
[CP.44](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#cp44-remember-to-name-your-lock_guards-and-unique_locks): Remember to name your lock_guards and unique_locks
1616

1717
The standard library provides a few useful classes which help to control concurrent access to resources. Objects of such types lock exclusive access for the duration of their lifetime. This implies that every lock object must be named, i.e. have clearly defined lifetime which spans through the period in which access operations are executed. So, failing to assign a lock object to a variable is a mistake which is effectively disables locking mechanism (because temporary variables are transient). This rule tries to catch simple cases of such unintended behavior.
1818

0 commit comments

Comments
 (0)