Revert^4 "Add spin loop to mutex, overhaul monitor"
This reverts commit ead89ef62768faa06fedd279b86bccbed1464673.
PS1 is identical to Revert^2.
This fixes a shutdown issue caused by prematurely hanging when we
block while trying to acquire system mutexes during shutdown.
Only refuse to wake up after shutdown is well under way.
Bug: 140590186
Bug: 121302864
Test: Build and boot AOSP.
Test: art/test/testrunner/testrunner.py --host -b -t 1932-monitor-events-misc
Test: art/test/testrunner/testrunner.py --host -b -t 004-ThreadStress
Test: art/test/testrunner/testrunner.py --host -b -t 132-daemon-locks-shutdown
Test: 132-daemon-locks-shutdown repeated with increased thread counts and multiple
concurrent tests.
Change-Id: Ic19d32652a2a05c1ca843b3e9c6e29e6770262da
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 0601b8d..ee9e4a8 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2307,6 +2307,12 @@
std::memory_order_release);
}
+#pragma clang diagnostic push
+#if !ART_USE_FUTEXES
+// Frame gets too large, perhaps due to Bionic pthread_mutex_lock size. We don't care.
+# pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
+// This has a large frame, but shouldn't be run anywhere near the stack limit.
void Heap::PreZygoteFork() {
if (!HasZygoteSpace()) {
// We still want to GC in case there is some unreachable non moving objects that could cause a
@@ -2467,6 +2473,7 @@
AddRememberedSet(post_zygote_non_moving_space_rem_set);
}
}
+#pragma clang diagnostic pop
void Heap::FlushAllocStack() {
MarkAllocStackAsLive(allocation_stack_.get());