Remove unused class (#2757)

This commit is contained in:
Mateusz Rzeszutek 2021-04-08 17:49:19 +02:00 committed by GitHub
parent a4ea1c9db2
commit c872513896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 33 deletions

View File

@ -1,33 +0,0 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.javaagent.tooling;
import java.util.concurrent.ThreadFactory;
/** A {@link ThreadFactory} implementation that starts all {@link Thread} as daemons. */
public final class DaemonThreadFactory implements ThreadFactory {
public static final DaemonThreadFactory TASK_SCHEDULER =
new DaemonThreadFactory("opentelemetry-task-scheduler");
private final String threadName;
/**
* Constructs a new {@code DaemonThreadFactory} with a null ContextClassLoader.
*
* @param threadName used to prefix all thread names.
*/
public DaemonThreadFactory(String threadName) {
this.threadName = threadName;
}
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(r, threadName);
thread.setDaemon(true);
thread.setContextClassLoader(null);
return thread;
}
}