Follow-up to #885 / #891.
PR #891 added Goccia.ThreadCleanupRegistry and routed the ~64 member-definition threadvars through it, but left the pre-existing per-thread cache clears as explicit calls inside Goccia.Threading.ShutdownThreadRuntime to avoid destabilising working teardown in that PR:
This leaves two cleanup idioms coexisting (explicit calls + registry drain). Migrate the explicit cache/memo clears into the registry so there is one mechanism, then drop them from ShutdownThreadRuntime (keeping the ordered object-lifecycle shutdowns — GC / CallStack / MicrotaskQueue — explicit).
Note the Atomics nuance: ShutdownThreadRuntime uses the per-thread ShutdownAtomicsWaitersForCurrentThread while the unit finalization uses the all-threads ShutdownAtomicsWaiters; preserve that distinction when migrating.
Acceptance criteria
ShutdownThreadRuntime contains no per-thread managed-cache/memo clear calls; they all register with Goccia.ThreadCleanupRegistry.
- Each migrated unit drops its now-redundant explicit wiring; main-thread cleanup is preserved (via the registry finalization or the unit's own finalization).
- Full JS suite (both modes) + Pascal
Goccia.ThreadCleanupLeak.Test + Goccia.Threading.Test stay green.
Follow-up to #885 / #891.
PR #891 added
Goccia.ThreadCleanupRegistryand routed the ~64 member-definition threadvars through it, but left the pre-existing per-thread cache clears as explicit calls insideGoccia.Threading.ShutdownThreadRuntimeto avoid destabilising working teardown in that PR:ClearImportMetaCache,ShutdownAtomicsWaitersForCurrentThread,ClearDisposableStackSlotMap,ClearSemverHosts,ClearTimeZoneCacheClearRegExpInputMemo,ClearAsciiMemoThis leaves two cleanup idioms coexisting (explicit calls + registry drain). Migrate the explicit cache/memo clears into the registry so there is one mechanism, then drop them from
ShutdownThreadRuntime(keeping the ordered object-lifecycle shutdowns — GC / CallStack / MicrotaskQueue — explicit).Note the Atomics nuance:
ShutdownThreadRuntimeuses the per-threadShutdownAtomicsWaitersForCurrentThreadwhile the unitfinalizationuses the all-threadsShutdownAtomicsWaiters; preserve that distinction when migrating.Acceptance criteria
ShutdownThreadRuntimecontains no per-thread managed-cache/memo clear calls; they all register withGoccia.ThreadCleanupRegistry.Goccia.ThreadCleanupLeak.Test+Goccia.Threading.Teststay green.