diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2023-01-15 15:09:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 15:09:26 (GMT) |
commit | f6307d44167e9c110a1db442f7a33deb365e89a8 (patch) | |
tree | 2966452677fbc35a33b68b6e78f38a07350603e4 /Include | |
parent | 206f05a46b426eb374f724f8e7cd42f2f9643bb8 (diff) | |
download | cpython-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.h | 6 |
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 |