Optimization, stop thread when job is done.