fix thread_pool bugs