mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-109693: Update _gil_runtime_state.locked to use pyatomic.h (gh-110836)
This commit is contained in:
parent
06f844eaa0
commit
86559ddfec
8 changed files with 86 additions and 18 deletions
|
|
@ -8,7 +8,6 @@ extern "C" {
|
|||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "pycore_atomic.h" // _Py_atomic_int
|
||||
#include "pycore_condvar.h" // PyCOND_T
|
||||
|
||||
#ifndef Py_HAVE_CONDVAR
|
||||
|
|
@ -28,7 +27,7 @@ struct _gil_runtime_state {
|
|||
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;
|
||||
int locked;
|
||||
/* Number of GIL switches since the beginning. */
|
||||
unsigned long switch_number;
|
||||
/* This condition variable allows one or several threads to wait
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue