fix_thread_bug