Skip to content

Commit

Permalink
#12 Shutdown the default ScheduledExecutorService at JVM exit.
Browse files Browse the repository at this point in the history
  • Loading branch information
vy committed Jan 9, 2020
1 parent d0af6ff commit e50622d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### (2020-??-??) v0.9.2

- Shutdown the default `ScheduledExecutorService` at JVM exit. (#12)

### (2019-12-08) v0.9.1

- Added explicit Java 9 module name. (#11)
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/vlkan/rfos/RotationConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ private static ScheduledThreadPoolExecutor createDefaultExecutorService() {
threadCount,
new ThreadFactory() {

private volatile int threadCount = 0;
private int threadCount = 0;

@Override
public synchronized Thread newThread(Runnable runnable) {
String name = String.format("RotationJanitor-%02d", ++threadCount);
return new Thread(runnable, name);
Thread thread = new Thread(runnable, name);
thread.setDaemon(true);
return thread;
}

});
Expand Down

0 comments on commit e50622d

Please sign in to comment.