Fix 'gn gen --check' hanging indefinitely

r531270 refactored HeaderChecker to use an atomic counter to track the number of
header-checking tasks.  The main thread waits on the task count becoming zero,
and the task counter is decremented whenever a task completes.  However, the
main thread didn't increment the task counter when it created a task, so the
counter would count into negative values and never reach zero, hanging gn
indefinitely.  The fix is to increment the counter when posting a task.

R=dpranke
CC=fdoray

Change-Id: Id55f943cf0e2af3e9e5af5f3dddf8a7b7671eaac
Reviewed-on: https://chromium-review.googlesource.com/889930
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#532684}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7c742b6ec9b635a42b37df65efb28d30f9cc8fcb
1 file changed
tree: 7d526c735078fe2c3a4b819ea25fa484d87a1ed2
  1. tools/