Add some comments about thread dumping and suspension.
Change-Id: I7903a363f8ab37a6af936dd963e6a321d61c3084
diff --git a/src/thread.cc b/src/thread.cc
index 74d58e3..5eb7373 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -859,6 +859,9 @@
}
void Thread::DumpStack(std::ostream& os) const {
+ // TODO: we call this code when dying but may not have suspended the thread ourself. The
+ // IsSuspended check is therefore racy with the use for dumping (normally we inhibit
+ // the race with the thread_suspend_count_lock_).
if (this == Thread::Current() || IsSuspended()) {
// If we're currently in native code, dump that stack before dumping the managed stack.
if (ShouldShowNativeStack(this)) {