mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-117398: Use Per-Interpreter State for the _datetime Static Types (gh-119929)
We make use of the same mechanism that we use for the static builtin types. This required a few tweaks. The relevant code could use some cleanup but I opted to avoid the significant churn in this change. I'll tackle that separately. This change is the final piece needed to make _datetime support multiple interpreters. I've updated the module slot accordingly.
This commit is contained in:
parent
dba7a167db
commit
105f22ea46
13 changed files with 384 additions and 169 deletions
|
@ -1066,7 +1066,7 @@ PyObject_ClearWeakRefs(PyObject *object)
|
|||
void
|
||||
_PyStaticType_ClearWeakRefs(PyInterpreterState *interp, PyTypeObject *type)
|
||||
{
|
||||
static_builtin_state *state = _PyStaticType_GetState(interp, type);
|
||||
managed_static_type_state *state = _PyStaticType_GetState(interp, type);
|
||||
PyObject **list = _PyStaticType_GET_WEAKREFS_LISTPTR(state);
|
||||
// This is safe to do without holding the lock in free-threaded builds;
|
||||
// there is only one thread running and no new threads can be created.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue