Skip to content

Commit

Permalink
Set thread as a daemon is the thread factory in order to avoid blocki…
Browse files Browse the repository at this point in the history
…ng main thread
  • Loading branch information
surli authored and monperrus committed Mar 20, 2017
1 parent fd70431 commit 6964139
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -12,6 +12,7 @@ public CustomClassLoaderThreadFactory(ClassLoader customClassLoader) {
@Override
public Thread newThread(Runnable r) {
Thread newThread = Executors.defaultThreadFactory().newThread(r);
newThread.setDaemon(true); // use to avoid a main process to continue running waiting for this thread end at the end of execution
newThread.setContextClassLoader(customClassLoader());
return newThread;
}
Expand Down

0 comments on commit 6964139

Please sign in to comment.