Refactor thread pool to support lazy initialization.

PiperOrigin-RevId: 397152910
This commit is contained in:
jfcarroll
2021-09-16 13:19:03 -07:00
committed by Copybara-Service
parent c6ebc3162f
commit 233c5f5337
6 changed files with 231 additions and 108 deletions
+2 -2
View File
@@ -55,13 +55,13 @@ bool Executor::InitializeThreadPool() {
// https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html#execute-java.lang.Runnable-
void Executor::Execute(Runnable&& runnable) {
if (shut_down_) {
NEARBY_LOGS(ERROR) << "Error: " << __func__
NEARBY_LOGS(VERBOSE) << "Warning: " << __func__
<< ": Attempt to execute on a shut down pool.";
return;
}
if (runnable == nullptr) {
NEARBY_LOGS(ERROR) << "Error: " << __func__ << "Runnable was null.";
NEARBY_LOGS(VERBOSE) << "Error: " << __func__ << "Runnable was null.";
return;
}