There is no deadlock in your code, JVM doesn't shutdowned because it have working thread - executor thread for exec
service(defined in ThreadDeadlock
).
If you add
exec.shutdown();
before return
in RenderPageTask
then program will terminate after all tasks will be completed.