-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock for writing in ControlCore::SetBackgroundOpacity
#10357
Conversation
…in-use variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a bit of regexp:
(render)?\S*engine\S*->(SetCallback|SetWarningCallback|ToggleShaderEffects|SetRetroTerminalEffect|SetPixelShaderPath|SetForceFullRepaintRendering|SetSoftwareRendering|GetSwapChainHandle|Invalidate|InvalidateCursor|InvalidateSystem|InvalidateSelection|InvalidateScroll|InvalidateAll|InvalidateCircling|PrepareForTeardown|StartPaint|EndPaint|RequiresContinuousRedraw|WaitUntilCanRender|Present|ScrollFrame|PrepareRenderInfo|PaintBackground|PaintBufferLine|PaintBufferGridLines|PaintSelection|PaintCursor|UpdateDrawingBrushes|UpdateFont|UpdateDpi|UpdateViewport|GetProposedFont|GetDirtyArea|GetFontSize|IsGlyphWideByFont|GetViewportInCharacters|GetViewportInPixels|SetSelectionBackground|SetAntialiasingMode|SetDefaultTextBackgroundOpacity|UpdateHyperlinkHoveredId)
...I found some more places that might need fixing:
const auto viewInPixels = publicTerminal->_renderEngine->GetViewportInPixels(viewInCharacters); const auto viewInCharacters = publicTerminal->_renderEngine->GetViewportInCharacters(viewInPixels); return _renderEngine->GetSwapChainHandle(); terminal/src/cascadia/TerminalControl/TermControl.cpp
Lines 1845 to 1846 in d7f2a39
LOG_IF_FAILED(dxEngine->UpdateDpi(dpi)); LOG_IF_FAILED(dxEngine->UpdateFont(desiredFont, actualFont));
But that doesn't make this change in itself any less correct.
👉 Approve.
The first 3 are probably "LockForReading" if they can't deal with a potentially dirty or invalid piece of data. But yes. Thank you. |
|
I think so. It might have adjusted a bit with the multiprocess stuff. I don't want to mess with it while @zadjii-msft technically has those things in flight. |
Hello @miniksa! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
## PR Checklist * [x] Closes random crash that @lhecker sent me on Teams * [x] I work here. ## Detailed Description of the Pull Request / Additional comments - Any change to the renderer engine has to be done under lock. Leonard gave me a crash where the dirty rectangles changed out from under the renderer thread. By inspection, only one spot in `ControlCore` is modifying the engine outside of lock.... here. The dump is too far along to definitively prove the issue and it's sort of a race so its difficult to repro. But the theory is sound that all writes to the dirty regions must be done under lock. So here's a fix. (cherry picked from commit 94d39b7)
🎉 Handy links: |
🎉 Handy links: |
PR Checklist
Detailed Description of the Pull Request / Additional comments
ControlCore
is modifying the engine outside of lock.... here. The dump is too far along to definitively prove the issue and it's sort of a race so its difficult to repro. But the theory is sound that all writes to the dirty regions must be done under lock. So here's a fix.