Remove use of synchronization/lock from tools/gn/command_gen
Change-Id: I1daf264fe85c6cf8fd2caa3324620ab87496cc2d
Reviewed-on: https://gn-review.googlesource.com/1720
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
diff --git a/tools/gn/command_gen.cc b/tools/gn/command_gen.cc
index 0b291f2..af5dd1f 100644
--- a/tools/gn/command_gen.cc
+++ b/tools/gn/command_gen.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <mutex>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
@@ -50,7 +52,7 @@
// Collects Ninja rules for each toolchain. The lock protectes the rules.
struct TargetWriteInfo {
- base::Lock lock;
+ std::mutex lock;
NinjaWriter::PerToolchainRules rules;
};
@@ -60,7 +62,7 @@
DCHECK(!rule.empty());
{
- base::AutoLock lock(write_info->lock);
+ std::lock_guard<std::mutex> lock(write_info->lock);
write_info->rules[target->toolchain()].emplace_back(target,
std::move(rule));
}