diff --git a/jsystemd-core/src/main/java/com/github/jpmsilva/jsystemd/Systemd.java b/jsystemd-core/src/main/java/com/github/jpmsilva/jsystemd/Systemd.java index ea0cac8..d4c1731 100644 --- a/jsystemd-core/src/main/java/com/github/jpmsilva/jsystemd/Systemd.java +++ b/jsystemd-core/src/main/java/com/github/jpmsilva/jsystemd/Systemd.java @@ -20,6 +20,8 @@ import static java.util.concurrent.TimeUnit.SECONDS; import com.github.jpmsilva.groundlevel.utilities.StringUtilities; +import org.apache.commons.lang3.concurrent.BasicThreadFactory; + import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -43,7 +45,9 @@ public class Systemd implements AutoCloseable { private final SystemdNotify systemdNotify = SystemdUtilities.getSystemdNotify(); - private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); + private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1, new BasicThreadFactory.Builder() + .namingPattern("Systemd-%d") + .build()); private final List providers = new CopyOnWriteArrayList<>(); private long timeout = MICROSECONDS.convert(29, SECONDS);