gh-131238: Remove pycore_lock.h includes (#131483)

PyMutex type is now part of <Python.h>, it's no longer needed to
include <pycore_lock.h> to get it.
This commit is contained in:
Victor Stinner 2025-03-20 00:46:25 +01:00 committed by GitHub
parent 6827c5129c
commit 344f3c3fd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 4 additions and 17 deletions

View 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" {

View 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

View 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

View 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

View 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

View 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

View 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>

View 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"

View 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

View 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 *);

View 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" {

View file

@ -11,7 +11,6 @@
#include <stdbool.h>
#include <stdint.h>
#include "pycore_lock.h" // PyMutex
#ifdef __cplusplus
extern "C" {

View 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

View 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"

View file

@ -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" {