Not re-enable background thread after fork.

Avoid calling pthread_create in postfork handlers.
This commit is contained in:
Qi Wang
2017-06-09 00:00:48 -07:00
committed by Qi Wang
parent 464cb60490
commit b83b5ad44a
3 changed files with 49 additions and 36 deletions

View File

@@ -750,7 +750,10 @@ mallctl("arena." STRINGIFY(MALLCTL_ARENAS_ALL) ".decay",
background threads will be no more than the number of CPUs or active
arenas). Threads run periodically, and handle <link
linkend="arena.i.decay">purging</link> asynchronously. When switching
off, background threads are terminated synchronously. See <link
off, background threads are terminated synchronously. Note that after
<citerefentry><refentrytitle>fork</refentrytitle><manvolnum>2</manvolnum></citerefentry>
function, the state in the child process will be disabled regardless
the state in parent process. See <link
linkend="stats.background_thread.num_threads"><mallctl>stats.background_thread</mallctl></link>
for related stats. <link
linkend="opt.background_thread"><mallctl>opt.background_thread</mallctl></link>