Make thread counting more robust
commit117f420cbf73f3fd37927963e4889eeeb251ec84
authorMark Williams <mwilliams@fb.com>
Wed, 2 May 2018 15:29:09 +0000 (2 08:29 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 2 May 2018 15:48:14 +0000 (2 08:48 -0700)
treeca902ef3c24bd4ec6a4b640d9a1db8d3e26274f9
parent5e4ee24f3d5394ff369a71c23090b9607fe6e893
Make thread counting more robust

Summary:
When running a dbg build under gdb, I get the

  HHVM is broken: %u threads running in hugifyText()

message about 1 out of every 3 runs. If I set a breakpoint on that
line, and then do `info thread` when it fires, gdb always tells me
there's only one thread; so there seems to be a race.

Try to fix it by sleeping and retrying.

Reviewed By: binliu19

Differential Revision: D7814401

fbshipit-source-id: 16f45e99394a748150d8bac2c9cecc15d2ceea29
hphp/runtime/base/program-functions.cpp