summaryrefslogtreecommitdiff
path: root/runtime/thread_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/thread_list.h')
-rw-r--r--runtime/thread_list.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/thread_list.h b/runtime/thread_list.h
index 92702c6498..41c5e328b0 100644
--- a/runtime/thread_list.h
+++ b/runtime/thread_list.h
@@ -23,6 +23,7 @@
#include "base/time_utils.h"
#include "base/value_object.h"
#include "jni.h"
+#include "suspend_reason.h"
#include <bitset>
#include <list>
@@ -64,7 +65,7 @@ class ThreadList {
void ResumeAll()
REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_)
UNLOCK_FUNCTION(Locks::mutator_lock_);
- void Resume(Thread* thread, bool for_debugger = false)
+ void Resume(Thread* thread, SuspendReason reason = SuspendReason::kInternal)
REQUIRES(!Locks::thread_suspend_count_lock_);
// Suspends all threads and gets exclusive access to the mutator_lock_.
@@ -81,7 +82,9 @@ class ThreadList {
// If the thread should be suspended then value of request_suspension should be true otherwise
// the routine will wait for a previous suspend request. If the suspension times out then *timeout
// is set to true.
- Thread* SuspendThreadByPeer(jobject peer, bool request_suspension, bool debug_suspension,
+ Thread* SuspendThreadByPeer(jobject peer,
+ bool request_suspension,
+ SuspendReason reason,
bool* timed_out)
REQUIRES(!Locks::mutator_lock_,
!Locks::thread_list_lock_,
@@ -91,7 +94,7 @@ class ThreadList {
// thread on success else null. The thread id is used to identify the thread to avoid races with
// the thread terminating. Note that as thread ids are recycled this may not suspend the expected
// thread, that may be terminating. If the suspension times out then *timeout is set to true.
- Thread* SuspendThreadByThreadId(uint32_t thread_id, bool debug_suspension, bool* timed_out)
+ Thread* SuspendThreadByThreadId(uint32_t thread_id, SuspendReason reason, bool* timed_out)
REQUIRES(!Locks::mutator_lock_,
!Locks::thread_list_lock_,
!Locks::thread_suspend_count_lock_);
@@ -198,7 +201,7 @@ class ThreadList {
void SuspendAllInternal(Thread* self,
Thread* ignore1,
Thread* ignore2 = nullptr,
- bool debug_suspend = false)
+ SuspendReason reason = SuspendReason::kInternal)
REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_);
void AssertThreadsAreSuspended(Thread* self, Thread* ignore1, Thread* ignore2 = nullptr)