Add additional support for Thread::Current() == NULL.
Added checks for Thread::Current() == NULL so that we don't crash in Runtime::~Runtime() when we have to wait for a concurrent GC to complete.
Change-Id: I3164c01f3eb668c7e8fa29c8a0d5a48b8f0e4fb1
diff --git a/src/monitor.cc b/src/monitor.cc
index 8bb7e45..50deba6 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -184,8 +184,9 @@
return;
}
- uint64_t waitStart, waitEnd;
if (!lock_.TryLock()) {
+ uint64_t waitStart = 0;
+ uint64_t waitEnd = 0;
uint32_t wait_threshold = lock_profiling_threshold_;
const Method* current_locking_method = NULL;
uint32_t current_locking_dex_pc = 0;