FIR IDE: allow the same entity to be accessed from different threads

This commit is contained in:
Ilya Kirillov
2020-07-06 19:24:58 +03:00
parent 4c08dfb238
commit 964becf138
3 changed files with 11 additions and 18 deletions
@@ -33,7 +33,6 @@ interface ValidityOwnerByValidityToken : ValidityOwner {
class ReadActionConfinementValidityToken(project: Project) : ValidityOwner {
private val modificationTracker = KotlinModificationTrackerService.getInstance(project).modificationTracker
private val ownerThread = Thread.currentThread()
private val onCreatedTimeStamp = modificationTracker.modificationCount
@@ -41,7 +40,6 @@ class ReadActionConfinementValidityToken(project: Project) : ValidityOwner {
val application = ApplicationManager.getApplication()
if (application.isDispatchThread) return false
if (!application.isReadAccessAllowed) return false
if (ownerThread != Thread.currentThread()) return false
return onCreatedTimeStamp == modificationTracker.modificationCount
}
@@ -49,9 +47,6 @@ class ReadActionConfinementValidityToken(project: Project) : ValidityOwner {
val application = ApplicationManager.getApplication()
if (application.isDispatchThread) return "Called in EDT thread"
if (!application.isReadAccessAllowed) return "Called outside read action"
if (ownerThread != Thread.currentThread()) {
return "Called outside the thread was created in (was created in $ownerThread, but accessed in ${Thread.currentThread()}"
}
if (onCreatedTimeStamp != modificationTracker.modificationCount) return "PSI has changed since creation"
error("Getting invalidation reason for valid invalidatable")
}