Create thread_safe