Skip to content

Commit

Permalink
Merge b4dbb3b into b056859
Browse files Browse the repository at this point in the history
  • Loading branch information
adinauer authored May 30, 2023
2 parents b056859 + b4dbb3b commit 60431b9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sentry/src/main/java/io/sentry/SentryExecutorService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;
Expand All @@ -18,7 +19,7 @@ final class SentryExecutorService implements ISentryExecutorService {
}

SentryExecutorService() {
this(Executors.newSingleThreadScheduledExecutor());
this(Executors.newSingleThreadScheduledExecutor(new SentryExecutorServiceThreadFactory()));
}

@Override
Expand Down Expand Up @@ -59,4 +60,15 @@ public boolean isClosed() {
return executorService.isShutdown();
}
}

private static final class SentryExecutorServiceThreadFactory implements ThreadFactory {
private int cnt;

@Override
public @NotNull Thread newThread(final @NotNull Runnable r) {
final Thread ret = new Thread(r, "SentryExecutorServiceThreadFactory-" + cnt++);
ret.setDaemon(true);
return ret;
}
}
}

0 comments on commit 60431b9

Please sign in to comment.