Go to native for image decompression thread pool wait
We should not be holding the mutator lock since that will maybe
cause DCHECK failures.
Bug: 131318971
Test: test-art-host
(cherry picked from commit f1890fd47361788e859a533e447d4d393be651b7)
Merged-In: I14064b06adb9ec0e83af6afb70320f184fd2aed0
Change-Id: Id3e34ec9bd9082aaea8367b65cd90e6bd499b6c0
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index d037e1d..3e3d199 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -926,7 +926,8 @@
int fd,
TimingLogger* logger,
/*inout*/MemMap* image_reservation,
- /*out*/std::string* error_msg) {
+ /*out*/std::string* error_msg)
+ REQUIRES_SHARED(Locks::mutator_lock_) {
TimingLogger::ScopedTiming timing("MapImageFile", logger);
std::string temp_error_msg;
const bool is_compressed = image_header.HasCompressedBlock();
@@ -995,6 +996,8 @@
}
if (use_parallel) {
ScopedTrace trace("Waiting for workers");
+ // Go to native since we don't want to suspend while holding the mutator lock.
+ ScopedThreadSuspension sts(Thread::Current(), kNative);
pool->Wait(self, true, false);
}
const uint64_t time = NanoTime() - start;