thr_join optimize