From 6e759ad477a30e09cce8ca59ed30180aceb8aff6 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 17 May 2016 10:13:10 -0700 Subject: [PATCH] ART: Fix systrace monitor logging Thinlock unlocking was incorrectly unconditionally ending a block. Bug: 28423466 (cherry picked from commit 825ab1c3f44fd84e5967f023c2dd8d36c6906f08) Change-Id: Ifaebd9e959041e157e292d4cba05675a37e9c700 --- runtime/monitor.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/runtime/monitor.cc b/runtime/monitor.cc index f4bc222d1..71c866f3d 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -964,17 +964,13 @@ bool Monitor::MonitorExit(Thread* self, mirror::Object* obj) { 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; } -- 2.11.0