-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Fix a race condition in CTerminalHandoff::s_StopListening #13410
Conversation
s_StopListening(); | ||
|
||
std::unique_lock lock{ _mtx }; | ||
LOG_IF_FAILED(s_StopListeningLocked()); |
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.
FYI this change is correct (i.e. holding the lock while calling s_StopListening
).
Previously, s_StopListening
would acquire the lock itself, so nothing has effectively changed here.
Hello @DHowett! 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 (
|
This commit fixes a minor race condition covered as part of #13368. The member `_pfnHandoff` was read without the mutex `_mtx` being locked first. The issue was solved by acquiring the lock early and running the entire `s_StopListening` function with that lock held. (cherry picked from commit 95a1962) Service-Card-Id: 83893125 Service-Version: 1.14
This commit fixes a minor race condition covered as part of #13368. The member `_pfnHandoff` was read without the mutex `_mtx` being locked first. The issue was solved by acquiring the lock early and running the entire `s_StopListening` function with that lock held. (cherry picked from commit 95a1962) Service-Card-Id: 83893126 Service-Version: 1.15
🎉 Handy links: |
🎉 Handy links: |
This commit fixes a minor race condition covered as part of #13368.
The member
_pfnHandoff
was read without the mutex_mtx
being locked first.The issue was solved by acquiring the lock early and running the entire
s_StopListening
function with that lock held.