Skip to content

Commit 7db281c

Browse files
committed
Major re-work, TYPE_LOCK protects more things.
Rather than trying to update tp_base, tp_bases, and tp_mro while the world is stopped, hold TYPE_LOCK when updating them. This is much more similar to how the base version of the code works and requires many fewer changes. Using stop-the-world turned out to be difficult to make work correctly, mostly due to custom mro() methods but also for some other reasons (for example, functions that potentially re-enter the interpreter). This re-work requires that we can call stop-the-world inside a critical section and have the mutex still held after re-starting. This seems to work and I've added asserts to confirm it. Stop-the-world is now only used when updating either tp_flags or other type slots and not the three type members listed above.
1 parent f5df0c3 commit 7db281c

File tree

1 file changed

+175
-163
lines changed

1 file changed

+175
-163
lines changed

0 commit comments

Comments
 (0)