diff options
author | 2017-06-29 11:59:50 -0700 | |
---|---|---|
committer | 2017-06-30 14:24:56 +0000 | |
commit | 46f9340f2a055a8fdfebbfbb739c697c20d83e7c (patch) | |
tree | acb172f74723e4ea9ac7ded73b94c661217ec90d /runtime/monitor.cc | |
parent | fe9a4f061841a3c597aac6817a47c799c54fcad7 (diff) |
Add SuspendReason enum and change Suspension functions.
More self-documenting and more type safe.
Bug: 62821960
Test: ./test.py
Change-Id: Ic7a1ae6a25e687d65f5aa10c1aad54a7b80dd086
Diffstat (limited to 'runtime/monitor.cc')
-rw-r--r-- | runtime/monitor.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/monitor.cc b/runtime/monitor.cc index 940afc8448..3e3eaae13a 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -898,7 +898,9 @@ void Monitor::InflateThinLocked(Thread* self, Handle<mirror::Object> obj, LockWo Thread* owner; { ScopedThreadSuspension sts(self, kBlocked); - owner = thread_list->SuspendThreadByThreadId(owner_thread_id, false, &timed_out); + owner = thread_list->SuspendThreadByThreadId(owner_thread_id, + SuspendReason::kInternal, + &timed_out); } if (owner != nullptr) { // We succeeded in suspending the thread, check the lock's status didn't change. @@ -908,7 +910,7 @@ void Monitor::InflateThinLocked(Thread* self, Handle<mirror::Object> obj, LockWo // Go ahead and inflate the lock. Inflate(self, owner, obj.Get(), hash_code); } - thread_list->Resume(owner, false); + thread_list->Resume(owner, SuspendReason::kInternal); } self->SetMonitorEnterObject(nullptr); } |