From 8d0882d14cdd830eee9245d026c800001a49a6f5 Mon Sep 17 00:00:00 2001 From: AN Long Date: Sun, 11 Feb 2024 23:29:19 +0800 Subject: [PATCH 1/3] gh-115304: Correct the typical initialization of PyMutex in its comment document --- Include/internal/pycore_lock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/internal/pycore_lock.h b/Include/internal/pycore_lock.h index 18a8896d97a548..e6bd7aec63e2b3 100644 --- a/Include/internal/pycore_lock.h +++ b/Include/internal/pycore_lock.h @@ -26,7 +26,7 @@ extern "C" { // 0b11: locked and has parked threads // // Typical initialization: -// PyMutex m = (PyMutex){0}; +// PyMutex m = {0}; // // Typical usage: // PyMutex_Lock(&m); From 3178031d2e36e6e6b8ac9ce9152e9737ab584c56 Mon Sep 17 00:00:00 2001 From: AN Long Date: Sat, 17 Feb 2024 15:29:32 +0800 Subject: [PATCH 2/3] apply review suggestions --- Include/internal/pycore_lock.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Include/internal/pycore_lock.h b/Include/internal/pycore_lock.h index e6bd7aec63e2b3..87c990f03aa39d 100644 --- a/Include/internal/pycore_lock.h +++ b/Include/internal/pycore_lock.h @@ -26,7 +26,10 @@ extern "C" { // 0b11: locked and has parked threads // // Typical initialization: -// PyMutex m = {0}; +// PyMutex m = (PyMutex){0}; +// +// Or initialize as global variables: +// PyMutex m; // // Typical usage: // PyMutex_Lock(&m); From d4c44193588d2e063f932444b737908007922f18 Mon Sep 17 00:00:00 2001 From: AN Long Date: Wed, 21 Feb 2024 13:27:50 +0800 Subject: [PATCH 3/3] Update Include/internal/pycore_lock.h Co-authored-by: Sam Gross --- Include/internal/pycore_lock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/internal/pycore_lock.h b/Include/internal/pycore_lock.h index 87c990f03aa39d..1bd9afff52790a 100644 --- a/Include/internal/pycore_lock.h +++ b/Include/internal/pycore_lock.h @@ -29,7 +29,7 @@ extern "C" { // PyMutex m = (PyMutex){0}; // // Or initialize as global variables: -// PyMutex m; +// static PyMutex m; // // Typical usage: // PyMutex_Lock(&m);