Remove GetTid() since it is not used.

PiperOrigin-RevId: 393453493
This commit is contained in:
hai007
2021-08-27 16:50:05 -07:00
committed by Copybara-Service
parent ad82c4c489
commit 8e2f2da45d
6 changed files with 0 additions and 21 deletions
-2
View File
@@ -35,8 +35,6 @@ class Executor {
// https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html#shutdown--
virtual void Shutdown() = 0;
virtual int GetTid(int index) const = 0;
};
} // namespace api
@@ -47,11 +47,6 @@ class MultiThreadExecutor : public api::SubmittableExecutor {
void Shutdown() override { DoShutdown(); }
~MultiThreadExecutor() override { DoShutdown(); }
int GetTid(int index) const override {
const auto* thread = thread_pool_.thread(index);
return thread ? thread->tid() : 0;
}
void ScheduleAfter(absl::Duration delay, Runnable&& runnable) {
if (shutdown_) return;
thread_pool_.ScheduleAt(absl::Now() + delay, std::move(runnable));
@@ -43,8 +43,6 @@ class ScheduledExecutor final : public api::ScheduledExecutor {
absl::Duration delay) override;
void Shutdown() override { executor_.Shutdown(); }
int GetTid(int index) const override { return executor_.GetTid(index); }
private:
SingleThreadExecutor executor_;
};
-6
View File
@@ -78,12 +78,6 @@ class ABSL_LOCKABLE ScheduledExecutor final : public Lockable {
DoShutdown();
}
int GetTid(int index) const {
MutexLock lock(&mutex_);
return impl_->GetTid(index);
}
int Tid() const { return GetTid(0); }
Cancelable Schedule(Runnable&& runnable, absl::Duration duration)
ABSL_LOCKS_EXCLUDED(mutex_) {
MutexLock lock(&mutex_);
@@ -33,7 +33,6 @@ class ABSL_LOCKABLE SingleThreadExecutor final : public SubmittableExecutor {
~SingleThreadExecutor() override = default;
SingleThreadExecutor(SingleThreadExecutor&&) = default;
SingleThreadExecutor& operator=(SingleThreadExecutor&&) = default;
int Tid() const { return GetTid(0); }
};
} // namespace nearby
@@ -73,11 +73,6 @@ class ABSL_LOCKABLE SubmittableExecutor : public api::SubmittableExecutor,
MonitoredRunnable(ThreadCheckRunnable(this, std::move(runnable))));
}
int GetTid(int index) const ABSL_LOCKS_EXCLUDED(mutex_) override {
MutexLock lock(&mutex_);
return impl_ ? impl_->GetTid(index) : 0;
}
void Shutdown() ABSL_LOCKS_EXCLUDED(mutex_) override {
MutexLock lock(&mutex_);
DoShutdown();