summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2015-02-24 14:56:59 +0100
committerSebastien Hertz <shertz@google.com>2015-02-25 17:29:21 +0100
commit813b9602dadeabf33439cb0592072744f6241ce5 (patch)
treea92393ce95b3e28d7ef9190352842fe58083d4d2 /runtime
parent0b6daeb0f0014474b542cbba1f713eb0dbefb7f9 (diff)
downloadart-813b9602dadeabf33439cb0592072744f6241ce5.tar.gz
art-813b9602dadeabf33439cb0592072744f6241ce5.tar.bz2
art-813b9602dadeabf33439cb0592072744f6241ce5.zip
JDWP: fix thread state on event suspension
Before suspending event thread, we ensure its state is kSuspended so the debugger sees it as RUNNING instead of WAIT. Bug: 19103406 Change-Id: I58b4141a958bf6a3c360f6994967fad0078ea373
Diffstat (limited to 'runtime')
-rw-r--r--runtime/jdwp/jdwp_event.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index b71f6cdfc4..fc08d23274 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -633,7 +633,11 @@ void JdwpState::SendRequestAndPossiblySuspend(ExpandBuf* pReq, JdwpSuspendPolicy
AcquireJdwpTokenForEvent(threadId);
}
EventFinish(pReq);
- SuspendByPolicy(suspend_policy, thread_self_id);
+ {
+ // Before suspending, we change our state to kSuspended so the debugger sees us as RUNNING.
+ ScopedThreadStateChange stsc(self, kSuspended);
+ SuspendByPolicy(suspend_policy, thread_self_id);
+ }
self->TransitionFromSuspendedToRunnable();
}