mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
GH-100892: consolidate HEAD_LOCK/HEAD_UNLOCK
macros (#100953)
This commit is contained in:
parent
206f05a46b
commit
f6307d4416
4 changed files with 6 additions and 14 deletions
|
@ -162,6 +162,12 @@ PyAPI_FUNC(int) _PyState_AddModule(
|
||||||
|
|
||||||
PyAPI_FUNC(int) _PyOS_InterruptOccurred(PyThreadState *tstate);
|
PyAPI_FUNC(int) _PyOS_InterruptOccurred(PyThreadState *tstate);
|
||||||
|
|
||||||
|
#define HEAD_LOCK(runtime) \
|
||||||
|
PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK)
|
||||||
|
#define HEAD_UNLOCK(runtime) \
|
||||||
|
PyThread_release_lock((runtime)->interpreters.mutex)
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -839,11 +839,6 @@ local_traverse(localobject *self, visitproc visit, void *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HEAD_LOCK(runtime) \
|
|
||||||
PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK)
|
|
||||||
#define HEAD_UNLOCK(runtime) \
|
|
||||||
PyThread_release_lock((runtime)->interpreters.mutex)
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
local_clear(localobject *self)
|
local_clear(localobject *self)
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,11 +97,6 @@
|
||||||
#define _Py_atomic_load_relaxed_int32(ATOMIC_VAL) _Py_atomic_load_relaxed(ATOMIC_VAL)
|
#define _Py_atomic_load_relaxed_int32(ATOMIC_VAL) _Py_atomic_load_relaxed(ATOMIC_VAL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HEAD_LOCK(runtime) \
|
|
||||||
PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK)
|
|
||||||
#define HEAD_UNLOCK(runtime) \
|
|
||||||
PyThread_release_lock((runtime)->interpreters.mutex)
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
static PyObject *trace_call_function(
|
static PyObject *trace_call_function(
|
||||||
PyThreadState *tstate, PyObject *callable, PyObject **stack,
|
PyThreadState *tstate, PyObject *callable, PyObject **stack,
|
||||||
|
|
|
@ -231,10 +231,6 @@ _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HEAD_LOCK(runtime) \
|
|
||||||
PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK)
|
|
||||||
#define HEAD_UNLOCK(runtime) \
|
|
||||||
PyThread_release_lock((runtime)->interpreters.mutex)
|
|
||||||
|
|
||||||
/* Forward declaration */
|
/* Forward declaration */
|
||||||
static void _PyGILState_NoteThreadState(
|
static void _PyGILState_NoteThreadState(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue