Explicitly enable/disable background threads in hugifyText
commit6074f9f44e787f8edf8576ee30b22753ccda9c32
authorMark Williams <mwilliams@fb.com>
Mon, 26 Feb 2018 22:55:14 +0000 (26 14:55 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 26 Feb 2018 23:02:24 +0000 (26 15:02 -0800)
treead5c17e84903433e959cd07973f6662cd5f91564
parent8658f0e83e808d6763df73bd78a5caa1fbbb7646
Explicitly enable/disable background threads in hugifyText

Summary:
The previous attempt uses malloc_conf to disable background threads,
and then enables them in hphp_process_init.

The problem with that is that MALLOC_CONF can still be used to enable
the background threads from the start (which leaves us with the same
problems as before), and it can no longer be used to disable
background threads, since we enable them unconditionally.

Since we only wanted to disable background threads for hugifyText, put
the code there, and save-disable-restore, rather than unconditionally disable/enable.

Reviewed By: paulbiss

Differential Revision: D7085748

fbshipit-source-id: 3b6441a1c59add6423400bb3384cfcff974a7c1d
hphp/runtime/base/program-functions.cpp
hphp/util/alloc.cpp