Bug 1875768 - Run PostForkMainThread before iterating the arenas r=glandium, a=dmeehan

Differential Revision: https://phabricator.services.mozilla.com/D212229
This commit is contained in:
Paul Bone 2024-07-04 03:51:07 +00:00
parent b7568d3cba
commit ab6a089199

View file

@ -5216,6 +5216,9 @@ void _malloc_postfork_parent(void) MOZ_NO_THREAD_SAFETY_ANALYSIS {
FORK_HOOK
void _malloc_postfork_child(void) {
// Do this before iterating over the arenas.
gArenas.PostForkFixMainThread();
// Reinitialize all mutexes, now that fork() has completed.
huge_mtx.Init();
@ -5225,7 +5228,6 @@ void _malloc_postfork_child(void) {
arena->mLock.Reinit(gForkingThread);
}
gArenas.PostForkFixMainThread();
gArenas.mLock.Init();
}
#endif // XP_WIN