Update select_thread_func()