replace global_mutex to thread_mutex