mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[^cdr] fix deadlock during background document commit
This commit is contained in:
@@ -559,11 +559,12 @@ public class DocumentCommitThread implements Runnable, Disposable, DocumentCommi
|
||||
return;
|
||||
}
|
||||
|
||||
boolean canceled = false;
|
||||
try {
|
||||
if (documentManager.isCommitted(document)) return;
|
||||
|
||||
if (!task.isStillValid()) {
|
||||
task.cancel("Task invalidated", DocumentCommitThread.this);
|
||||
canceled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -586,6 +587,9 @@ public class DocumentCommitThread implements Runnable, Disposable, DocumentCommi
|
||||
}
|
||||
finally {
|
||||
lock.unlock();
|
||||
if (canceled) {
|
||||
task.cancel("Task invalidated", DocumentCommitThread.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user