For JDWP, suspend thread before configuring it for single stepping.
Change-Id: I05a7c28c9e977885195797a78a492aa0f72801b7
diff --git a/src/jdwp/jdwp_event.cc b/src/jdwp/jdwp_event.cc
index 5b65aa4..56ba131 100644
--- a/src/jdwp/jdwp_event.cc
+++ b/src/jdwp/jdwp_event.cc
@@ -143,8 +143,6 @@
* not be added to the list, and an appropriate error will be returned.
*/
JdwpError JdwpState::RegisterEvent(JdwpEvent* pEvent) {
- MutexLock mu(Thread::Current(), event_list_lock_);
-
CHECK(pEvent != NULL);
CHECK(pEvent->prev == NULL);
CHECK(pEvent->next == NULL);
@@ -175,6 +173,7 @@
/*
* Add to list.
*/
+ MutexLock mu(Thread::Current(), event_list_lock_);
if (event_list_ != NULL) {
pEvent->next = event_list_;
event_list_->prev = pEvent;