void (PsiReference ref, boolean doLock) { if (doLock) { synchronized (IS_BEING_RESOLVED_KEY) { PsiElement elt = ref.getElement(); List<Thread> lockingThreads = elt.getUserData(IS_BEING_RESOLVED_KEY); if (lockingThreads == null) return; final Thread currentThread = Thread.currentThread(); lockingThreads.remove(currentThread); if (lockingThreads.isEmpty()) { elt.putUserData(IS_BEING_RESOLVED_KEY, null); } } } }