when the pool finish task, the pool need to be closed.