summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-09-04 13:26:21 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-09-11 13:14:20 -0700
commit4f55e22630d99ca0edd9e951e5ee96b57bb9b980 (patch)
tree84b7d55a6a7c31c09ed2865cc1bc2f4393476533 /compiler/driver/compiler_driver.cc
parent2d06e08d25bbf8eff1de945736a60810009e59ad (diff)
Add and use ScopedSuspendAll
Usage replaces most SuspendAll and ResumeAll calls. Change-Id: I355683a5365876242cea85a656dcb58455f7a294
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 9f05e64cf5..4c1408a177 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1140,23 +1140,20 @@ void CompilerDriver::UpdateImageClasses(TimingLogger* timings) {
if (IsImage()) {
TimingLogger::ScopedTiming t("UpdateImageClasses", timings);
- Runtime* current = Runtime::Current();
+ Runtime* runtime = Runtime::Current();
// Suspend all threads.
- current->GetThreadList()->SuspendAll(__FUNCTION__);
+ ScopedSuspendAll ssa(__FUNCTION__);
std::string error_msg;
std::unique_ptr<ClinitImageUpdate> update(ClinitImageUpdate::Create(image_classes_.get(),
Thread::Current(),
- current->GetClassLinker(),
+ runtime->GetClassLinker(),
&error_msg));
CHECK(update.get() != nullptr) << error_msg; // TODO: Soft failure?
// Do the marking.
update->Walk();
-
- // Resume threads.
- current->GetThreadList()->ResumeAll();
}
}