mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-16 23:51:44 +03:00
Fix fork(2)-related mutex acquisition order.
Fix mutex acquisition order inversion for the chunks rtree and the base mutex. Chunks rtree acquisition was introduced by the previous commit, so this bug was short-lived.
This commit is contained in:
parent
20f1fc95ad
commit
b5225928fe
1 changed files with 3 additions and 3 deletions
|
|
@ -1659,9 +1659,9 @@ _malloc_prefork(void)
|
|||
arena_prefork(arenas[i]);
|
||||
}
|
||||
prof_prefork();
|
||||
chunk_prefork();
|
||||
base_prefork();
|
||||
huge_prefork();
|
||||
chunk_prefork();
|
||||
}
|
||||
|
||||
#ifndef JEMALLOC_MUTEX_INIT_CB
|
||||
|
|
@ -1681,9 +1681,9 @@ _malloc_postfork(void)
|
|||
assert(malloc_initialized);
|
||||
|
||||
/* Release all mutexes, now that fork() has completed. */
|
||||
chunk_postfork_parent();
|
||||
huge_postfork_parent();
|
||||
base_postfork_parent();
|
||||
chunk_postfork_parent();
|
||||
prof_postfork_parent();
|
||||
for (i = 0; i < narenas; i++) {
|
||||
if (arenas[i] != NULL)
|
||||
|
|
@ -1701,9 +1701,9 @@ jemalloc_postfork_child(void)
|
|||
assert(malloc_initialized);
|
||||
|
||||
/* Release all mutexes, now that fork() has completed. */
|
||||
chunk_postfork_child();
|
||||
huge_postfork_child();
|
||||
base_postfork_child();
|
||||
chunk_postfork_child();
|
||||
prof_postfork_child();
|
||||
for (i = 0; i < narenas; i++) {
|
||||
if (arenas[i] != NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue