Makes things threadsafe.