Set thread status

PiperOrigin-RevId: 557942242
This commit is contained in:
Janusz Sobczak
2023-08-17 14:47:35 -07:00
committed by Copybara-Service
parent 7933842c29
commit 408344244f
+4 -1
View File
@@ -16,11 +16,13 @@
#include <utility>
// 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) {