ART: Fix systrace monitor logging
Thinlock unlocking was incorrectly unconditionally ending a block.
Bug: 28423466
(cherry picked from commit 825ab1c3f44fd84e5967f023c2dd8d36c6906f08)
Change-Id: Ifaebd9e959041e157e292d4cba05675a37e9c700
diff --git a/runtime/monitor.cc b/runtime/monitor.cc
index f4bc222..71c866f 100644
--- a/runtime/monitor.cc
+++ b/runtime/monitor.cc
@@ -964,17 +964,13 @@
if (!kUseReadBarrier) {
DCHECK_EQ(new_lw.ReadBarrierState(), 0U);
h_obj->SetLockWord(new_lw, true);
- if (ATRACE_ENABLED()) {
- ATRACE_END();
- }
+ AtraceMonitorUnlock();
// Success!
return true;
} else {
// Use CAS to preserve the read barrier state.
if (h_obj->CasLockWordWeakSequentiallyConsistent(lock_word, new_lw)) {
- if (ATRACE_ENABLED()) {
- ATRACE_END();
- }
+ AtraceMonitorUnlock();
// Success!
return true;
}