Refactored cross_thread_mutex