gem thread_safe