gn: Remove redundant calls to Scheduler::Increment/DecrementWorkCount().
It is useless to call IncrementWorkCount() before ScheduleWork() and
DecrementWorkCount() at the end of a callback scheduled by
ScheduleWork(). Indeed, ScheduleWork() already calls
IncrementWorkCount() and DecrementWorkCount() is already called after
the execution of callbacks scheduled by ScheduleWork().
BUG=
Review-Url: https://codereview.chromium.org/2526673003
Cr-Original-Commit-Position: refs/heads/master@{#436369}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b0d8fb49cc75e8e6c6c7513754afe2ac54b5c8a7
diff --git a/tools/gn/command_gen.cc b/tools/gn/command_gen.cc
index aac61e7..26fc729 100644
--- a/tools/gn/command_gen.cc
+++ b/tools/gn/command_gen.cc
@@ -63,8 +63,6 @@
write_info->rules[target->toolchain()].emplace_back(
target, std::move(rule));
}
-
- g_scheduler->DecrementWorkCount();
}
// Called on the main thread.
@@ -73,7 +71,6 @@
const Item* item = record->item();
const Target* target = item->AsTarget();
if (target) {
- g_scheduler->IncrementWorkCount();
g_scheduler->ScheduleWork(base::Bind(&BackgroundDoWrite,
write_info, target));
}