Skip to content

Commit 6a360e8

Browse files
committed
fix type lock
1 parent e2dd5ad commit 6a360e8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Objects/typeobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6080,7 +6080,11 @@ _PyType_SetFlagsRecursive(PyTypeObject *self, unsigned long mask, unsigned long
60806080
can reassign a version tag before the flag update. */
60816081
type_lock_prevent_release();
60826082
types_stop_world();
6083+
/* Make TYPE_LOCK visible while mutating tp_flags. */
6084+
type_lock_allow_release();
60836085
set_flags_recursive(self, mask, flags);
6086+
/* Hide TYPE_LOCK again before restarting the world. */
6087+
type_lock_prevent_release();
60846088
types_start_world();
60856089
type_lock_allow_release();
60866090
END_TYPE_LOCK();

0 commit comments

Comments
 (0)