mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[log] IDEA-125309 One more fix for a possible deadlock
General practice is not to invoke some external code under a lock. Here the result handler can safely be called before the lock: if new requests arrive, they will be added to the queue in request(), and a new background task will be started after result is handled.
This commit is contained in:
@@ -85,8 +85,8 @@ public abstract class SingleTaskController<Request, Result> {
|
||||
* The result is immediately passed to the result handler specified in the constructor.
|
||||
*/
|
||||
protected final void taskCompleted(@NotNull Result result) {
|
||||
myResultHandler.consume(result);
|
||||
synchronized (LOCK) {
|
||||
myResultHandler.consume(result);
|
||||
if (myAwaitingRequests.isEmpty()) {
|
||||
myActive = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user