release the resouce of the unused thread.