OSDN Git Service

malloc_debug: reset TrackData mutex after fork
authorColin Cross <ccross@android.com>
Mon, 8 Feb 2016 06:51:15 +0000 (22:51 -0800)
committerColin Cross <ccross@android.com>
Sat, 13 Feb 2016 00:41:14 +0000 (16:41 -0800)
commit7a28a3cf1f8df36e30724e8b4021cddde0596118
tree2add78d5dcf97d4cb4f360fba7b512656be70313
parent9750a77b31f2fc6d548a02b3a9750c2794648fea
malloc_debug: reset TrackData mutex after fork

Add a pthread_atfork handler to malloc_debug to lock the TrackData mutex
during fork and reset it in the child.  Ensures that the TrackData is
consistent when forking from a multi-threaded process, and that the
mutex is in a defined state in the child.

Change-Id: I0dfed30045a28551217ceac227d33b2e18894932
libc/malloc_debug/DebugData.cpp
libc/malloc_debug/DebugData.h
libc/malloc_debug/TrackData.h
libc/malloc_debug/malloc_debug.cpp