java - ExecutorService shutdown -


i confused javadoc of executorservice#shutdown method. aren't these contradictory statements?

initiates orderly shutdown in submitted tasks executed, no new tasks accepted. method not wait submitted tasks complete execution. use awaittermination that.

if can orderly shutdown submitted tasks, how can't wait them complete execution?

it means method returns in thread call in, tasks haven't yet been executed might still running, in other threads.

if want program wait until tasks had been submitted have finished, have call awaittermination after calling shutdown.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -