PyBuiltinCache () { while (true) { PyBuiltinCache pyBuiltinCache = myBuiltins.get(); if (pyBuiltinCache == null || !pyBuiltinCache.isValid()) { PyBuiltinCache newCache = new PyBuiltinCache(PyBuiltinCache.getBuiltinsForSdk(myProject, mySdk), PyBuiltinCache.getExceptionsForSdk(myProject, mySdk)); if (myBuiltins.compareAndSet(pyBuiltinCache, newCache)) { return newCache; } } else { return pyBuiltinCache; } } }