It's possible for too many threads to restart all at once and the EG instance never enters scope. The previous method wasn't guaranteed to have ExtraGlobal in the thread's frame.f_locals (maybe in globals? I didn't check =/) but MetaExtraGlobal was in scope (as it would just about be guaranteed to, since the race is only on the creation of the singleton EG instance, not the MEG definition). Since MEG resolves the initialized instance, we can pull that out instead.
It's possible for too many threads to restart all at once and the EG instance never enters scope. The previous method wasn't guaranteed to have
ExtraGlobal
in the thread'sframe.f_locals
(maybe in globals? I didn't check =/) butMetaExtraGlobal
was in scope (as it would just about be guaranteed to, since the race is only on the creation of the singleton EG instance, not the MEG definition). Since MEG resolves the initialized instance, we can pull that out instead.