solve problems in thread_join