Incorporating some wisdom from https://mikeash.com/pyblog/friday-qa-2011-10-14-whats-new-in-gcd.html to prevent race conditions in fromJson