CorsoSource / metatools

Ignition metatools - handy for things and stuff!
Apache License 2.0
23 stars 2 forks source link

Fixes for weird race conditions on startup #12

Closed null-directory closed 1 year ago

null-directory commented 1 year ago

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.