summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2023-01-15 15:09:26 (GMT)
committerGitHub <noreply@github.com>2023-01-15 15:09:26 (GMT)
commitf6307d44167e9c110a1db442f7a33deb365e89a8 (patch)
tree2966452677fbc35a33b68b6e78f38a07350603e4 /Include
parent206f05a46b426eb374f724f8e7cd42f2f9643bb8 (diff)
downloadcpython-f6307d44167e9c110a1db442f7a33deb365e89a8.zip
cpython-f6307d44167e9c110a1db442f7a33deb365e89a8.tar.gz
cpython-f6307d44167e9c110a1db442f7a33deb365e89a8.tar.bz2
GH-100892: consolidate `HEAD_LOCK/HEAD_UNLOCK` macros (#100953)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_pystate.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 3d6d400..736c2b3 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -162,6 +162,12 @@ PyAPI_FUNC(int) _PyState_AddModule(
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
}
#endif