diff options
author | Jason Evans <je@fb.com> | 2012-10-09 23:16:00 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-10-09 23:16:00 (GMT) |
commit | b5225928fe106a7d809bd34e849abcd6941e93c7 (patch) | |
tree | 2ec340e4f19223f23b75d19351226e04d5ffff9d /src/jemalloc.c | |
parent | 20f1fc95adb35ea63dc61f47f2b0ffbd37d39f32 (diff) | |
download | jemalloc-b5225928fe106a7d809bd34e849abcd6941e93c7.zip jemalloc-b5225928fe106a7d809bd34e849abcd6941e93c7.tar.gz jemalloc-b5225928fe106a7d809bd34e849abcd6941e93c7.tar.bz2 |
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.
Diffstat (limited to 'src/jemalloc.c')
-rw-r--r-- | src/jemalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c index 4ea1f75..b04da18 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -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) |