Stiffen util/perf-event's contract around signal handlers
commit09a1aa545c6f72d34ecb9fc084d43f5ee60fb139
authorMax Wang <mwang@fb.com>
Thu, 1 Sep 2016 16:59:04 +0000 (1 09:59 -0700)
committerHhvm Bot <hhvm-bot-bot@fb.com>
Thu, 1 Sep 2016 17:08:51 +0000 (1 10:08 -0700)
tree0d9c112cb9dd41aaa2bd8a93b4ab67c3ff4dbc1b
parentf51aa63844c4c05787471f31b86d963dff39d763
Stiffen util/perf-event's contract around signal handlers

Summary:
Be more defensive about things that may affect signal-handling:
- If a SIGIO handler is already installed, fail.  This currently issues
  a warning, because HHVM should not have any other SIGIO handlers,
  unless perhaps the user specifies one via the process control
  extension.  If anyone is doing that who also wants to use this
  module... well, too bad.
- If SIGIO has been blocked, unblock it.  In practice, this does in fact
  happen due to the behavior of SignalHandlers in the process control
  extension.

Reviewed By: markw65

Differential Revision: D3803684

fbshipit-source-id: c4e75a907d42da6ee956f6f5c5e1152aa95c59f8
hphp/util/perf-event.cpp
hphp/util/perf-event.h