Fix gn CHECK()ing when generating Chromium build files

After r531270, gn chokes while running exec_script():

[0124/122441.126364:FATAL:thread_restrictions.cc(105)] Check failed:
!g_base_sync_primitives_disallowed.Get().Get().

GN executes scripts synchronously while loading files, so blocking is necessary.
This CL adds a ScopedAllowBaseSyncPrimitives for gn to use while waiting for
exec_script() to complete.

BUG=805628
R=dpranke,thestig,fdoray

Change-Id: I7ad539a8dee0230c84d94f1c6b37755a890bfcd7
Reviewed-on: https://chromium-review.googlesource.com/884423
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#532069}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5d2531613139a1c409dfacd28d03b05b2100fcfe
1 file changed
tree: 322ad38ed5d87ab1f63186fc694af5f25f2c74e2
  1. tools/