Index: base/threading/platform_thread_posix.cc |
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc |
index cb20ba860fc579fe0086c2ee43893b6c2d6444b9..ed90dcf6edd76435f953492d58433e8ea5c3456b 100644 |
--- a/base/threading/platform_thread_posix.cc |
+++ b/base/threading/platform_thread_posix.cc |
@@ -16,6 +16,7 @@ |
#include <memory> |
+#include "base/debug/activity_tracker.h" |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/threading/platform_thread_internal_posix.h" |
@@ -202,6 +203,9 @@ bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) { |
// static |
void PlatformThread::Join(PlatformThreadHandle thread_handle) { |
+ // Record the event that this thread is blocking upon (for hang diagnosis). |
+ base::debug::ScopedThreadJoinActivity thread_activity(&thread_handle); |
+ |
// Joining another thread may block the current thread for a long time, since |
// the thread referred to by |thread_handle| may still be running long-lived / |
// blocking tasks. |