From 408344244f4e4f86de7a9bae8f8055ffbd4b836a Mon Sep 17 00:00:00 2001 From: Janusz Sobczak Date: Thu, 17 Aug 2023 14:46:10 -0700 Subject: [PATCH] Set thread status PiperOrigin-RevId: 557942242 --- internal/platform/monitored_runnable.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/platform/monitored_runnable.cc b/internal/platform/monitored_runnable.cc index e0952298..792a580f 100644 --- a/internal/platform/monitored_runnable.cc +++ b/internal/platform/monitored_runnable.cc @@ -16,11 +16,13 @@ #include +// TODO: Support thread status #include "internal/platform/logging.h" #include "internal/platform/pending_job_registry.h" -namespace nearby { +#define SET_THREAD_STATUS(NAME) +namespace nearby { namespace { absl::Duration kMinReportedStartDelay = absl::Seconds(5); absl::Duration kMinReportedTaskDuration = absl::Seconds(10); @@ -36,6 +38,7 @@ MonitoredRunnable::MonitoredRunnable(const std::string& name, } void MonitoredRunnable::operator()() { + SET_THREAD_STATUS(name_.c_str()); auto start_time = SystemClock::ElapsedRealtime(); auto start_delay = start_time - post_time_; if (start_delay >= kMinReportedStartDelay) {