mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Set thread status
PiperOrigin-RevId: 557942242
This commit is contained in:
committed by
Copybara-Service
parent
7933842c29
commit
408344244f
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user