Thread creation cleanup; always use named threads
I went through every single place that instantiates a thread or thread
pool and cleaned up the corresponding code a bit in some cases, and made
sure that we always pass in a name.
PiperOrigin-RevId: 220099627
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java
index 35446dc..435a9a3 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionInactivityWatchdog.java
@@ -106,14 +106,8 @@
this.reporter = Preconditions.checkNotNull(reporter);
this.sleeper = Preconditions.checkNotNull(sleeper);
this.waitTime = new WaitTime(progressIntervalFlagValue);
- this.thread = new Thread(new Runnable() {
- @Override
- public void run() {
- enterWatchdogLoop();
- }
- });
+ this.thread = new Thread(() -> enterWatchdogLoop(), "action-execution-watchdog");
this.thread.setDaemon(true);
- this.thread.setName("action-execution-watchdog");
}
/** Starts the watchdog thread. This method should only be called once. */