diff options
author | 2017-06-29 11:59:50 -0700 | |
---|---|---|
committer | 2017-06-30 14:24:56 +0000 | |
commit | 46f9340f2a055a8fdfebbfbb739c697c20d83e7c (patch) | |
tree | acb172f74723e4ea9ac7ded73b94c661217ec90d /runtime/thread-inl.h | |
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/thread-inl.h')
-rw-r--r-- | runtime/thread-inl.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h index 7da15d9f4c..95608b5f63 100644 --- a/runtime/thread-inl.h +++ b/runtime/thread-inl.h @@ -330,12 +330,12 @@ inline void Thread::PoisonObjectPointersIfDebug() { inline bool Thread::ModifySuspendCount(Thread* self, int delta, AtomicInteger* suspend_barrier, - bool for_debugger) { + SuspendReason reason) { if (delta > 0 && ((kUseReadBarrier && this != self) || suspend_barrier != nullptr)) { // When delta > 0 (requesting a suspend), ModifySuspendCountInternal() may fail either if // active_suspend_barriers is full or we are in the middle of a thread flip. Retry in a loop. while (true) { - if (LIKELY(ModifySuspendCountInternal(self, delta, suspend_barrier, for_debugger))) { + if (LIKELY(ModifySuspendCountInternal(self, delta, suspend_barrier, reason))) { return true; } else { // Failure means the list of active_suspend_barriers is full or we are in the middle of a @@ -354,7 +354,7 @@ inline bool Thread::ModifySuspendCount(Thread* self, } } } else { - return ModifySuspendCountInternal(self, delta, suspend_barrier, for_debugger); + return ModifySuspendCountInternal(self, delta, suspend_barrier, reason); } } |