diff options
author | Victor Stinner <vstinner@python.org> | 2024-02-20 16:50:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 16:50:43 (GMT) |
commit | d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0 (patch) | |
tree | 3c48d470b84dce1673490fb262e4733c105cd315 /Python | |
parent | e976baba99a5c243ff3a3b5ef2fd14608a398338 (diff) | |
download | cpython-d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0.zip cpython-d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0.tar.gz cpython-d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0.tar.bz2 |
gh-110850: Cleanup pycore_time.h includes (#115724)
<pycore_time.h> include is no longer needed to get the PyTime_t type
in internal header files. This type is now provided by <Python.h>
include. Add <pycore_time.h> includes to C files instead.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/gc.c | 1 | ||||
-rw-r--r-- | Python/gc_free_threading.c | 1 | ||||
-rw-r--r-- | Python/import.c | 1 | ||||
-rw-r--r-- | Python/lock.c | 7 | ||||
-rw-r--r-- | Python/parking_lot.c | 9 | ||||
-rw-r--r-- | Python/thread_nt.h | 3 | ||||
-rw-r--r-- | Python/thread_pthread.h | 1 |
7 files changed, 15 insertions, 8 deletions
diff --git a/Python/gc.c b/Python/gc.c index b665e46..907f29b 100644 --- a/Python/gc.c +++ b/Python/gc.c @@ -12,6 +12,7 @@ #include "pycore_object_alloc.h" // _PyObject_MallocWithType() #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_time.h" // _PyTime_GetPerfCounter() #include "pycore_weakref.h" // _PyWeakref_ClearRef() #include "pydtrace.h" diff --git a/Python/gc_free_threading.c b/Python/gc_free_threading.c index 0f159f4..88c9c4a 100644 --- a/Python/gc_free_threading.c +++ b/Python/gc_free_threading.c @@ -11,6 +11,7 @@ #include "pycore_object_stack.h" #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_time.h" // _PyTime_GetPerfCounter() #include "pycore_tstate.h" // _PyThreadStateImpl #include "pycore_weakref.h" // _PyWeakref_ClearRef() #include "pydtrace.h" diff --git a/Python/import.c b/Python/import.c index 6512963..a8fed67 100644 --- a/Python/import.c +++ b/Python/import.c @@ -13,6 +13,7 @@ #include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" // _PySys_Audit() +#include "pycore_time.h" // _PyTime_GetPerfCounter() #include "pycore_weakref.h" // _PyWeakref_GET_REF() #include "marshal.h" // PyMarshal_ReadObjectFromString() diff --git a/Python/lock.c b/Python/lock.c index 0c0d298..a4b044e 100644 --- a/Python/lock.c +++ b/Python/lock.c @@ -5,12 +5,13 @@ #include "pycore_lock.h" #include "pycore_parking_lot.h" #include "pycore_semaphore.h" +#include "pycore_time.h" // _PyTime_GetMonotonicClock() #ifdef MS_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include <windows.h> // SwitchToThread() +# define WIN32_LEAN_AND_MEAN +# include <windows.h> // SwitchToThread() #elif defined(HAVE_SCHED_H) -#include <sched.h> // sched_yield() +# include <sched.h> // sched_yield() #endif // If a thread waits on a lock for longer than TIME_TO_BE_FAIR_NS (1 ms), then diff --git a/Python/parking_lot.c b/Python/parking_lot.c index 9a8a403..9bf8376 100644 --- a/Python/parking_lot.c +++ b/Python/parking_lot.c @@ -1,11 +1,12 @@ #include "Python.h" #include "pycore_llist.h" -#include "pycore_lock.h" // _PyRawMutex +#include "pycore_lock.h" // _PyRawMutex #include "pycore_parking_lot.h" -#include "pycore_pyerrors.h" // _Py_FatalErrorFormat -#include "pycore_pystate.h" // _PyThreadState_GET -#include "pycore_semaphore.h" // _PySemaphore +#include "pycore_pyerrors.h" // _Py_FatalErrorFormat +#include "pycore_pystate.h" // _PyThreadState_GET +#include "pycore_semaphore.h" // _PySemaphore +#include "pycore_time.h" //_PyTime_GetMonotonicClock() #include <stdbool.h> diff --git a/Python/thread_nt.h b/Python/thread_nt.h index 9ca2a55..307352f 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -1,4 +1,5 @@ -#include "pycore_interp.h" // _PyInterpreterState.threads.stacksize +#include "pycore_interp.h" // _PyInterpreterState.threads.stacksize +#include "pycore_time.h" // _PyTime_AsMicroseconds() /* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */ /* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */ diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index ce0af73..9db6a46 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -1,5 +1,6 @@ #include "pycore_interp.h" // _PyInterpreterState.threads.stacksize #include "pycore_pythread.h" // _POSIX_SEMAPHORES +#include "pycore_time.h" // _PyTime_FromMicrosecondsClamup() /* Posix threads interface */ |