This repository was archived by the owner on Dec 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-50
lines changed
exporters/metrics/util/src/main/java/io/opencensus/exporter/metrics/util
impl_core/src/main/java/io/opencensus/implcore/internal Expand file tree Collapse file tree 3 files changed +8
-50
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -39,7 +39,13 @@ public final class IntervalMetricReader {
3939
4040 private IntervalMetricReader (Worker worker ) {
4141 this .worker = worker ;
42- this .workerThread = new DaemonThreadFactory ().newThread (worker );
42+ this .workerThread = new Thread (worker );
43+ try {
44+ this .workerThread .setName ("ExportWorkerThread" );
45+ this .workerThread .setDaemon (true );
46+ } catch (SecurityException e ) {
47+ // OK if we can't set the name or daemon in this environment.
48+ }
4349 workerThread .start ();
4450 }
4551
Original file line number Diff line number Diff line change 1616
1717package io .opencensus .implcore .internal ;
1818
19- import com .google .common .util .concurrent .MoreExecutors ;
2019import java .util .concurrent .ThreadFactory ;
2120import java .util .concurrent .atomic .AtomicInteger ;
2221
2322/** A {@link ThreadFactory} implementation that starts all {@link Thread} as daemons. */
2423public final class DaemonThreadFactory implements ThreadFactory {
2524 private static final String DELIMITER = "-" ;
26- private static final ThreadFactory threadFactory = MoreExecutors .platformThreadFactory ();
2725 private final AtomicInteger threadIdGen = new AtomicInteger ();
2826 private final String threadPrefix ;
2927
@@ -38,8 +36,7 @@ public DaemonThreadFactory(String threadPrefix) {
3836
3937 @ Override
4038 public Thread newThread (Runnable r ) {
41- Thread thread = threadFactory .newThread (r );
42- // AppEngine runtimes have constraints on thread renaming.
39+ Thread thread = new Thread (r );
4340 try {
4441 thread .setName (threadPrefix + threadIdGen .getAndIncrement ());
4542 thread .setDaemon (true );
You can’t perform that action at this time.
0 commit comments