mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
svn: Remove unnecessary locks in "RootsToWorkingCopies"
This also fixes the following deadlock in tests: * "addRoot()" method executes task synchronously in tests and calls "Application.invokeAndWait()" in the end to run task callbacks in EDT - see "CoreProgressManager.runProcessWithProgressInCurrentThread()" * "getWcRoot()" method is called in EDT in tests and tries to get "myLock" Prior to this commit "addRoot()" was called under "myLock" which caused deadlock with "getWcRoot()"
This commit is contained in:
@@ -25,12 +25,10 @@ class RootsToWorkingCopies(private val myVcs: SvnVcs) : VcsListener {
|
||||
private val myQueue = BackgroundTaskQueue(myProject, "SVN VCS roots authorization checker")
|
||||
private val myZipperUpdater = ZipperUpdater(200, Alarm.ThreadToUse.POOLED_THREAD, myProject)
|
||||
private val myRechecker = Runnable {
|
||||
clear()
|
||||
val roots = ProjectLevelVcsManager.getInstance(myProject).getRootsUnderVcs(myVcs)
|
||||
synchronized(myLock) {
|
||||
clear()
|
||||
for (root in roots) {
|
||||
addRoot(root)
|
||||
}
|
||||
for (root in roots) {
|
||||
addRoot(root)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,9 +98,11 @@ class RootsToWorkingCopies(private val myVcs: SvnVcs) : VcsListener {
|
||||
return resolvedWorkingCopy
|
||||
}
|
||||
|
||||
fun clear() = synchronized(myLock) {
|
||||
myRootMapping.clear()
|
||||
myUnversioned.clear()
|
||||
fun clear() {
|
||||
synchronized(myLock) {
|
||||
myRootMapping.clear()
|
||||
myUnversioned.clear()
|
||||
}
|
||||
myZipperUpdater.stop()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user