mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-140544: use faster _PyInterpreterState_GET for type lock (#140584)
This commit is contained in:
parent
ef4665f918
commit
df07364106
1 changed files with 1 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ class object "PyObject *" "&PyBaseObject_Type"
|
||||||
// the type has been revealed to other threads or we only do those updates
|
// the type has been revealed to other threads or we only do those updates
|
||||||
// while the stop-the-world mechanism is active. The slots and flags are read
|
// while the stop-the-world mechanism is active. The slots and flags are read
|
||||||
// in many places without holding a lock and without atomics.
|
// in many places without holding a lock and without atomics.
|
||||||
#define TYPE_LOCK &PyInterpreterState_Get()->types.mutex
|
#define TYPE_LOCK &_PyInterpreterState_GET()->types.mutex
|
||||||
#define BEGIN_TYPE_LOCK() Py_BEGIN_CRITICAL_SECTION_MUTEX(TYPE_LOCK)
|
#define BEGIN_TYPE_LOCK() Py_BEGIN_CRITICAL_SECTION_MUTEX(TYPE_LOCK)
|
||||||
#define END_TYPE_LOCK() Py_END_CRITICAL_SECTION()
|
#define END_TYPE_LOCK() Py_END_CRITICAL_SECTION()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue