Skip to content

Commit 0475c8e

Browse files
Update Include/internal/pycore_critical_section.h
Use braces to restrict scope of conditional locking Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent 536defc commit 0475c8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Include/internal/pycore_critical_section.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ extern "C" {
124124
&_orig_seq->ob_mutex) \
125125

126126
# define Py_END_CRITICAL_SECTION_SEQUENCE_FAST() \
127-
if (_should_lock_cs) \
127+
if (_should_lock_cs) { \
128128
_PyCriticalSection_End(&_cs); \
129+
} \
129130
}
130131

131132
// Asserts that the mutex is locked. The mutex must be held by the

0 commit comments

Comments
 (0)