Make pthread_mutex_t destruction safer during shutdown.
If we have suspended daemon threads, they might be holding some of the mutexes
we need to destroy, so we can't assert that we successfully destroyed them. We
still want to assert success where possible, though.
Bug: 5869254
Change-Id: Id4f3af3d40b10045958e7d692b3c9eebafec566d
diff --git a/src/runtime.h b/src/runtime.h
index d30f465..913779a 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -85,6 +85,7 @@
// Starts a runtime, which may cause threads to be started and code to run.
void Start();
+ bool IsShuttingDown() const;
bool IsStarted() const;
static Runtime* Current() {
@@ -268,6 +269,7 @@
// As returned by ClassLoader.getSystemClassLoader()
ClassLoader* system_class_loader_;
+ bool shutting_down_;
bool started_;
// Hooks supported by JNI_CreateJavaVM