mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] IJPL-223937: Propagate context to read action checks for rescheduling
Since lambda passed to `backendExecutor.execute(r)` is ContextAwareRunnable we should handle context ourselves GitOrigin-RevId: 450d1f069520b870384956785f3f67af9b1019bd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
11068cb986
commit
7919f276af
+12
-1
@@ -561,7 +561,18 @@ public final class NonBlockingReadActionImpl<T> implements NonBlockingReadAction
|
||||
}
|
||||
finally {
|
||||
if (builder.myCoalesceEquality != null) {
|
||||
release();
|
||||
if (AppExecutorUtil.propagateContext()) {
|
||||
// `release` should be called under [myChildContext] as well
|
||||
// since it executes some code to check when to call computation, and this code may rely on the context
|
||||
// e.g. in analyzer: Application and Project are stored in context and `release` uses Application
|
||||
ThreadContext.installThreadContext(myChildContext.getContext(), true, () -> {
|
||||
release();
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
else {
|
||||
release();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user