Doesn't actually fix race condition, just turns it from a LinkageError in one thread to both threads deadlocking.