summaryrefslogtreecommitdiffstats
path: root/src/jemalloc_cpp.cpp
diff options
context:
space:
mode:
authorDavid Goldblatt <davidgoldblatt@fb.com>2017-07-10 21:05:33 (GMT)
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2017-07-11 01:17:12 (GMT)
commit0a4f5a7eea5e42292cea95fd30a88201c8d4a1ca (patch)
treec5daad84e2de228a201fd0f5d02cff4ecfb59f3b /src/jemalloc_cpp.cpp
parentaa44ddbcdd43cc8a8352b654f4a003d83b9c15b7 (diff)
downloadjemalloc-0a4f5a7eea5e42292cea95fd30a88201c8d4a1ca.zip
jemalloc-0a4f5a7eea5e42292cea95fd30a88201c8d4a1ca.tar.gz
jemalloc-0a4f5a7eea5e42292cea95fd30a88201c8d4a1ca.tar.bz2
Fix deadlock in multithreaded fork in OS X.
On OS X, we rely on the zone machinery to call our prefork and postfork handlers. In zone_force_unlock, we call jemalloc_postfork_child, reinitializing all our mutexes regardless of state, since the mutex implementation will assert if the tid of the unlocker is different from that of the locker. This has the effect of unlocking the mutexes, but also fails to wake any threads waiting on them in the parent. To fix this, we track whether or not we're the parent or child after the fork, and unlock or reinit as appropriate. This resolves #895.
Diffstat (limited to 'src/jemalloc_cpp.cpp')
0 files changed, 0 insertions, 0 deletions