diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2014-05-13 00:20:43 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-13 00:20:43 +0000 |
commit | e920cfd076f8cc806818bc115690c45289ed742c (patch) | |
tree | 897cda900ed52a1fd29aa8400068d044bb88efc6 /runtime/gc | |
parent | 653bc0eaff1a7f8ca057e03c3379fe22a9b523c2 (diff) | |
parent | a6a8d142e60076db1ed6035119856779533bd09e (diff) | |
download | art-e920cfd076f8cc806818bc115690c45289ed742c.zip art-e920cfd076f8cc806818bc115690c45289ed742c.tar.gz art-e920cfd076f8cc806818bc115690c45289ed742c.tar.bz2 |
Merge "Fix a lock level violation with background compaction enabled."
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/heap.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index f2919e8..7235729 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1331,11 +1331,6 @@ void Heap::TransitionCollector(CollectorType collector_type) { if (collector_type == collector_type_) { return; } - if (Runtime::Current()->IsShuttingDown(self)) { - // Don't allow heap transitions to happen if the runtime is shutting down since these can - // cause objects to get finalized. - return; - } // GC can be disabled if someone has a used GetPrimitiveArrayCritical but not yet released. if (!copying_transition || disable_moving_gc_count_ == 0) { // TODO: Not hard code in semi-space collector? @@ -1345,6 +1340,12 @@ void Heap::TransitionCollector(CollectorType collector_type) { } usleep(1000); } + if (Runtime::Current()->IsShuttingDown(self)) { + // Don't allow heap transitions to happen if the runtime is shutting down since these can + // cause objects to get finalized. + FinishGC(self, collector::kGcTypeNone); + return; + } tl->SuspendAll(); switch (collector_type) { case kCollectorTypeSS: |