Bug 437451. keep arenas_lock during fork to avoid deadlock, r=karlt,a=bsmedberg
authorKazuhi Ohta <kazuki.ohta@gmail.com>
Mon, 17 Jan 2011 10:49:32 +1300
changeset 60679 3f8ae66d0015
parent 60678 b1350908332c
child 60680 57f3f4e9935f
push id18070
push userrocallahan@mozilla.com
push dateSun, 16 Jan 2011 21:49:54 +0000
treeherdermozilla-central@3f8ae66d0015 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, bsmedberg
bugs437451
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 437451. keep arenas_lock during fork to avoid deadlock, r=karlt,a=bsmedberg
memory/jemalloc/jemalloc.c
--- a/memory/jemalloc/jemalloc.c
+++ b/memory/jemalloc/jemalloc.c
@@ -6312,17 +6312,16 @@ void
 
 	/* Acquire all mutexes in a safe order. */
 
 	malloc_spin_lock(&arenas_lock);
 	for (i = 0; i < narenas; i++) {
 		if (arenas[i] != NULL)
 			malloc_spin_lock(&arenas[i]->lock);
 	}
-	malloc_spin_unlock(&arenas_lock);
 
 	malloc_mutex_lock(&base_mtx);
 
 	malloc_mutex_lock(&huge_mtx);
 }
 
 void
 _malloc_postfork(void)
@@ -6330,17 +6329,16 @@ void
 	unsigned i;
 
 	/* Release all mutexes, now that fork() has completed. */
 
 	malloc_mutex_unlock(&huge_mtx);
 
 	malloc_mutex_unlock(&base_mtx);
 
-	malloc_spin_lock(&arenas_lock);
 	for (i = 0; i < narenas; i++) {
 		if (arenas[i] != NULL)
 			malloc_spin_unlock(&arenas[i]->lock);
 	}
 	malloc_spin_unlock(&arenas_lock);
 }
 
 /*