]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131238: Remove pycore_lock.h includes (#131483)
authorVictor Stinner <vstinner@python.org>
Wed, 19 Mar 2025 23:46:25 +0000 (00:46 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Mar 2025 23:46:25 +0000 (23:46 +0000)
PyMutex type is now part of <Python.h>, it's no longer needed to
include <pycore_lock.h> to get it.

15 files changed:
Include/internal/pycore_ast_state.h
Include/internal/pycore_atexit.h
Include/internal/pycore_brc.h
Include/internal/pycore_ceval_state.h
Include/internal/pycore_code.h
Include/internal/pycore_codecs.h
Include/internal/pycore_critical_section.h
Include/internal/pycore_crossinterp.h
Include/internal/pycore_function.h
Include/internal/pycore_import.h
Include/internal/pycore_pymem.h
Include/internal/pycore_qsbr.h
Include/internal/pycore_unicodeobject.h
Include/internal/pycore_weakref.h
Parser/asdl_c.py

index 09ae95465495c01e32a78d00eac8989786762b08..2f9d5ea366eade35eb7a6f7a5d2d8329c5c0821c 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef Py_INTERNAL_AST_STATE_H
 #define Py_INTERNAL_AST_STATE_H
 
-#include "pycore_lock.h"    // _PyOnceFlag
+#include "pycore_lock.h"          // _PyOnceFlag
 
 #ifdef __cplusplus
 extern "C" {
index 4d4c455cc4b24ff24be69656015448eaf5b497f2..1199b00ead3769c43457ff2e0adc2c8ec0b75103 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef Py_INTERNAL_ATEXIT_H
 #define Py_INTERNAL_ATEXIT_H
 
-#include "pycore_lock.h"        // PyMutex
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index 3453d83b57ca97e5dcc0ca4c98a1ced4e8b0fc1c..cd3c9ac26b5a66d92a46d00df5bfd195e123a803 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <stdint.h>
 #include "pycore_llist.h"           // struct llist_node
-#include "pycore_lock.h"            // PyMutex
 #include "pycore_object_stack.h"    // _PyObjectStack
 
 #ifdef __cplusplus
index 8077c8c68819e3c2a0394348f7c625539c616b2d..64128a78136e56378107d45b3f92068922ddd8cf 100644 (file)
@@ -8,7 +8,6 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_lock.h"            // PyMutex
 #include "pycore_gil.h"             // struct _gil_runtime_state
 
 
index a1a04815d86536baeac95632b7eea372cb8577b5..e6c388080ea79c7b75aa85f23562a50e493f3053 100644 (file)
@@ -10,7 +10,6 @@ extern "C" {
 
 #include "pycore_structs.h"     // _Py_CODEUNIT
 #include "pycore_stackref.h"    // _PyStackRef
-#include "pycore_lock.h"        // PyMutex
 #include "pycore_backoff.h"     // _Py_BackoffCounter
 #include "pycore_tstate.h"      // _PyThreadStateImpl
 
index 01b31d31998e5378cadf73974839c91be88f9bda..52dca1362592d693e5871d87bbda01cb2cd9420d 100644 (file)
@@ -9,7 +9,6 @@ extern "C" {
 #endif
 
 #include "pycore_interp_structs.h" // struct codecs_state
-#include "pycore_lock.h"          // PyMutex
 
 /* Initialize codecs-related state for the given interpreter, including
    registering the first codec search function. Must be called before any other
index e66d6d805c1b3b661f8b4cb9a4254130969f44aa..42f06b935bd0a0f9b5a96735c882f16e7542d1e2 100644 (file)
@@ -5,7 +5,7 @@
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_lock.h"        // PyMutex
+#include "pycore_lock.h"        // PyMutex_LockFast()
 #include "pycore_pystate.h"     // _PyThreadState_GET()
 #include <stdint.h>
 
index 69a60d73e05c269dc92707ecb4d3f3ce476a3a69..d3226d2b425f6618ac8b53eebb8dce593a805f07 100644 (file)
@@ -8,7 +8,6 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_lock.h"            // PyMutex
 #include "pycore_pyerrors.h"
 
 
index 8fa040fec3bf0307cd294f37af0e97b4a31a4358..209252b2ddc0de4fb697fa0e91fd36a2ace3a9ea 100644 (file)
@@ -4,8 +4,6 @@
 extern "C" {
 #endif
 
-#include "pycore_lock.h"
-
 #ifndef Py_BUILD_CORE
 #  error "this header requires Py_BUILD_CORE define"
 #endif
index f99ab59140f0dced5cb9c0a678df08229adbb5e2..3acafd02bbdd7c4fb76c9662793c164808b33c4d 100644 (file)
@@ -11,7 +11,6 @@ extern "C" {
 
 #include "pycore_hashtable.h"     // _Py_hashtable_t
 #include "pycore_interp_structs.h" // _import_state
-#include "pycore_lock.h"          // PyMutex
 
 extern int _PyImport_IsInitialized(PyInterpreterState *);
 
index aa20190e252a2d8230a5f2db6679e56c6e496c90..02537bdfef85989f39629e9c94bcc3e2cbd8521a 100644 (file)
@@ -2,7 +2,6 @@
 #define Py_INTERNAL_PYMEM_H
 
 #include "pycore_llist.h"           // struct llist_node
-#include "pycore_lock.h"            // PyMutex
 
 #ifdef __cplusplus
 extern "C" {
index 20e643e172b38d7f38009323efefb35b6d756730..b835c3abaf5d0b22fdd8bcd9bf77297aaebb8d9e 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include "pycore_lock.h"        // PyMutex
 
 #ifdef __cplusplus
 extern "C" {
index c22be338df48a37f4dc9d56adead83632f80a702..34600ee6a9d1d44f903eac41685e40b757c3fdf7 100644 (file)
@@ -8,7 +8,6 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_lock.h"          // PyMutex
 #include "pycore_fileutils.h"     // _Py_error_handler
 #include "pycore_ucnhash.h"       // _PyUnicode_Name_CAPI
 #include "pycore_global_objects.h"  // _Py_SINGLETON
index 94aadb2c1547dd3e763f017794af7fe73cd8f822..950aa0af290056b269e57a451dacca37479ab65a 100644 (file)
@@ -9,7 +9,7 @@ extern "C" {
 #endif
 
 #include "pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION()
-#include "pycore_lock.h"
+#include "pycore_lock.h"             // PyMutex_LockFlags()
 #include "pycore_object.h"           // _Py_REF_IS_MERGED()
 #include "pycore_pyatomic_ft_wrappers.h"
 
index 82d84ac5bde381ec210f2606ad8cbb58f121ad6a..09e014534fbabc3a25c79275efaf7c9e6bd3b630 100755 (executable)
@@ -2368,7 +2368,7 @@ def write_internal_h_header(mod, f):
         #ifndef Py_INTERNAL_AST_STATE_H
         #define Py_INTERNAL_AST_STATE_H
 
-        #include "pycore_lock.h"    // _PyOnceFlag
+        #include "pycore_lock.h"          // _PyOnceFlag
 
         #ifdef __cplusplus
         extern "C" {