render: check the thread exit condition after every long operation#20097
Merged
render: check the thread exit condition after every long operation#20097
Conversation
We have received an internal report that teardown on OneCore is still
hanging. It looks like there's a chance that `TriggerTeardown` is called
during `PaintFrame`, which may result in `_threadShouldKeepRunning`
getting set to `false` (TriggerTeardown) and `_redraw` being set to
`false` as well (PaintFrame). The thread will wait forever on `_redraw`
to be signalled, which it never will, because `TriggerTeardown` is
waiting for the thread to exit.
That is:
```
Render Thread | ConIoSrv Thread
------------------------------------
Check _enabled |
Wait on _redraw |
Check _keepRunning | TriggerTeardown
Paint | _keepRunning = false
| _redraw = true
_redraw = false| Signal _enabled
Paint Completes | Wait on thread
Check _enabled |
Wait on _redraw |
**DEADLOCK** | **DEADLOCK**
v
```
This may not be an ideal fix, but at least it checks
`_threadShouldKeepRunning` after every "long" operation (waiting and
painting) now.
lhecker
approved these changes
Apr 9, 2026
|
Hello everyone, I am a new employee in your company. |
|
My job is a programmer, web development tester, website developer, and more. |
Member
Author
Very poor social engineering attack. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have received an internal report that teardown on OneCore is still hanging. It looks like there's a chance that
TriggerTeardownis called duringPaintFrame, which may result in_threadShouldKeepRunninggetting set tofalse(TriggerTeardown) and_redrawbeing set tofalseas well (PaintFrame). The thread will wait forever on_redrawto be signalled, which it never will, becauseTriggerTeardownis waiting for the thread to exit.That is:
This may not be an ideal fix, but at least it checks
_threadShouldKeepRunningafter every "long" operation (waiting and painting) now.