summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2016-06-24 16:18:21 -0700
committerJosh Gao <jmgao@google.com>2016-06-28 15:52:59 -0700
commitc80ffece02310ecdc8aefce26dd2b5f24cc6d4a9 (patch)
tree052d8f1b3a8d02f84e2471078e39eff1dfac3769 /libc/malloc_debug/malloc_debug.cpp
parent3e4590143904057bdc62b7bd7f38bd7429fff8e6 (diff)
Defer registration of the arc4random fork-detect handler.
Previously, arc4random would register a fork-detecting pthread_atfork handler to not have to call getpid() after a fork. pthread_atfork uses pthread_mutex_lock, which requires the current thread to be initialized, preventing the use of arc4random for initializing the global stack guard, which needs to happen before the main thread has been initialized. Extract the arc4random fork-detection flag and use the existing arc4random fork handler to set it. Bug: http://b/29622562 Change-Id: I98c9329fa0e489c3f78cad52747eaaf2f5226b80
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
0 files changed, 0 insertions, 0 deletions