Check if other threads are running before hugifyText
commit2f54110899dcba34e5ca375ebe5d4965c8450602
authorBin Liu <binliu@fb.com>
Wed, 28 Mar 2018 17:18:50 +0000 (28 10:18 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 28 Mar 2018 17:44:33 +0000 (28 10:44 -0700)
tree6bd9f2c7cb44de936f68c9f8ac56b562a9cf8f3c
parentcd8b1262f04c534a8997deedbcf6d4eded96a83a
Check if other threads are running before hugifyText

Summary:
We want to avoid accidentally create threads before hugifyText().  Otherwise hhvm can crash.
This uses a Linux-specific approach to count number of threads, and alarm people when more threads are detected.

Reviewed By: markw65

Differential Revision: D7391392

fbshipit-source-id: 3eb75b1088b5f21a1ba8918903a1e77a23f62aa8
hphp/runtime/base/program-functions.cpp
hphp/runtime/server/memory-stats.cpp
hphp/util/process.cpp
hphp/util/process.h