gh-109693: Update _gil_runtime_state.last_holder to use pyatomic.h (#110605)

This commit is contained in:
Donghee Na 2023-10-13 10:07:27 +09:00 committed by GitHub
parent 4a53a397c3
commit 2566434e59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -8,7 +8,7 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_atomic.h" // _Py_atomic_address
#include "pycore_atomic.h" // _Py_atomic_int
#include "pycore_condvar.h" // PyCOND_T
#ifndef Py_HAVE_CONDVAR
@ -25,7 +25,7 @@ struct _gil_runtime_state {
unsigned long interval;
/* Last PyThreadState holding / having held the GIL. This helps us
know whether anyone else was scheduled after we dropped the GIL. */
_Py_atomic_address last_holder;
PyThreadState* last_holder;
/* Whether the GIL is already taken (-1 if uninitialized). This is
atomic because it can be read without any lock taken in ceval.c. */
_Py_atomic_int locked;