ScriptClassRootsUpdater, updateSynchronously: cancel before waiting for lock

This commit is contained in:
Sergey Rostov
2020-05-07 15:52:27 +03:00
parent bc0255890d
commit 7de0bc9cdc
@@ -115,13 +115,11 @@ class ScriptClassRootsUpdater(
@Synchronized @Synchronized
private fun updateSynchronously() { private fun updateSynchronously() {
syncLock.withLock { scheduledUpdate?.cancel()
scheduledUpdate?.cancel() doUpdate(false)
doUpdate(false)
}
} }
fun doUpdate(underProgressManager: Boolean = true) { private fun doUpdate(underProgressManager: Boolean = true) {
syncLock.withLock { syncLock.withLock {
try { try {
val updates = manager.collectRootsAndCheckNew() val updates = manager.collectRootsAndCheckNew()