mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-15 20:26:04 +07:00
Add clarification comment about thread-safety of DirtyFiles
GitOrigin-RevId: 510fb3c4cb49a1d58f660e7891229429d88a4707
This commit is contained in:
committed by
intellij-monorepo-bot
parent
936e6c4c72
commit
0a14ce2dea
@@ -18,6 +18,10 @@ class DirtyFiles {
|
||||
for (project in projects) {
|
||||
val projectDirtyFiles = myDirtyFiles.find { it.first == project }?.second
|
||||
if (projectDirtyFiles != null) {
|
||||
// Technically, we can lose this file id if thread suspends here
|
||||
// then the project is closed, queue is persisted, and only then thread resumes.
|
||||
// To avoid this, we would need to add synchronized blocks when working with myDirtyFiles which will make file events processing slow
|
||||
// So I think it's ok to risk some inconsistency
|
||||
projectDirtyFiles.addFile(fileId)
|
||||
addedToAtLeastOneProject = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user