]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-115304: Add doc for initializing PyMutex as a global variable (#115305)
authorAN Long <aisk@users.noreply.github.com>
Wed, 21 Feb 2024 17:35:53 +0000 (01:35 +0800)
committerGitHub <noreply@github.com>
Wed, 21 Feb 2024 17:35:53 +0000 (12:35 -0500)
Include/internal/pycore_lock.h

index 07bf3db16f3d3afa3a5238867b27d9fd9c52b28a..c89159b55e130f6bc3e9f8defd8c0db45f58a195 100644 (file)
@@ -26,6 +26,9 @@ extern "C" {
 // Typical initialization:
 //   PyMutex m = (PyMutex){0};
 //
+// Or initialize as global variables:
+//   static PyMutex m;
+//
 // Typical usage:
 //   PyMutex_Lock(&m);
 //   ...