[RDCT] Fix potential race condition in RecentProjectsManagerBase

GitOrigin-RevId: 4597f249d5d6d3b1e1d6dbf86fcc04987811329e
This commit is contained in:
Vyacheslav Moklev
2025-02-24 11:29:16 +00:00
committed by intellij-monorepo-bot
parent 6efe6c9980
commit 16130c061b
@@ -603,10 +603,11 @@ open class RecentProjectsManagerBase(coroutineScope: CoroutineScope) :
*/
fun setProjectHidden(project: Project, hidden: Boolean) {
val path = getProjectPath(project) ?: return
val info = state.additionalInfo.get(path) ?: return
val oldHidden = info.hidden
info.hidden = hidden
if (oldHidden != hidden) {
synchronized(stateLock) {
val info = state.additionalInfo.get(path) ?: return
if (info.hidden == hidden) return
info.hidden = hidden
modCounter.increment()
}
}