GH-100892: consolidate HEAD_LOCK/HEAD_UNLOCK macros (#100953)

This commit is contained in:
Kumar Aditya 2023-01-15 20:39:26 +05:30 committed by GitHub
parent 206f05a46b
commit f6307d4416
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 14 deletions

View file

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