Remove call invokeAndWait() under read lock in debugger (KT-13037)
Call to invokeAndWait() in dispatch thread or in situation when read lock isn't held left untouched. Can't remove invokeAndWait() completely because without the progress bar idea looks to be stacked on debugger start because of long search for inline functions usages (searching for breakpoints places). #KT-13037 Fixed
This commit is contained in:
@@ -109,6 +109,7 @@ These artifacts include extensions for the types available in the latter JDKs, s
|
||||
###### Issues fixed
|
||||
|
||||
- [`KT-13059`](https://youtrack.jetbrains.com/issue/KT-13059) Fix error stepping on *Step Over* action in the end of while block
|
||||
- [`KT-13037`](https://youtrack.jetbrains.com/issue/KT-13037) Fix possible deadlock in debugger in 2016.1 and exception in 2016.2
|
||||
|
||||
## 1.0.3
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import com.intellij.debugger.engine.PositionManagerEx
|
||||
import com.intellij.debugger.engine.evaluation.EvaluationContext
|
||||
import com.intellij.debugger.jdi.StackFrameProxyImpl
|
||||
import com.intellij.debugger.requests.ClassPrepareRequestor
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ModalityState
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx
|
||||
import com.intellij.openapi.progress.ProgressManager
|
||||
import com.intellij.openapi.project.DumbService
|
||||
import com.intellij.openapi.roots.libraries.LibraryUtil
|
||||
@@ -468,14 +468,21 @@ class KotlinPositionManager(private val myDebugProcess: DebugProcess) : MultiReq
|
||||
}
|
||||
|
||||
var isSuccess = true
|
||||
ApplicationManager.getApplication().invokeAndWait(
|
||||
{
|
||||
isSuccess = ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||
task,
|
||||
"Compute class names for function $functionName",
|
||||
true,
|
||||
myDebugProcess.project)
|
||||
}, ModalityState.NON_MODAL)
|
||||
val applicationEx = ApplicationManagerEx.getApplicationEx()
|
||||
if (!applicationEx.holdsReadLock() || applicationEx.isDispatchThread) {
|
||||
applicationEx.invokeAndWait(
|
||||
{
|
||||
isSuccess = ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||
task,
|
||||
"Compute class names for function $functionName",
|
||||
true,
|
||||
myDebugProcess.project)
|
||||
}, ModalityState.NON_MODAL)
|
||||
}
|
||||
else {
|
||||
// Pooled thread with read lock. Can't invoke task under UI progress, so call it directly.
|
||||
task.run()
|
||||
}
|
||||
|
||||
if (!isSuccess) {
|
||||
XDebugSessionImpl.NOTIFICATION_GROUP.createNotification(
|
||||
|
||||
Reference in New Issue
Block a user