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
Add recursive_ticket_lock and use it for Terminal #13746
Conversation
fe7479b
to
5be3b6d
Compare
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.
Seems fine to me, but maybe we hold this till we fork off 1.16 / 1.17?
terminalLock.unlock(); | ||
{ | ||
// We then unlock the terminal, so the UI doesn't hang while we're busy. | ||
const auto suspension = _terminal->SuspendLock(); |
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.
So basically, this will release the lock on the terminal lock, but then wait to take the lock again as soon as suspension
goes out of scope?
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.
Yep exactly. It's like an inversion of std::lock_guard
. It's basically an std::unlock_guard
.
Hello @lhecker! 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 (
|
@msftbot make sure @DHowett signs off on this |
Hello @carlos-zamora! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
Have you re-tested this with the new MIDI changes? Sorry for the delay in my review lol |
I can do that, but I believe that it's not necessary. The MIDI changes work independent of our console lock mechanism and if this PR (or the other one) changed that, well... that would be quite a bug. 😅 |
🎉 Handy links: |
My hope with this commit is to make our code more robust against accidental
recursive locking, as well as making it easier to write code with confidence,
with only a slight performance trade-off.
Validation Steps Performed