-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Improve window thread termination #5781
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
Conversation
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.
BOOL getMessageResult; | ||
while ((getMessageResult = GetMessage(&msg, m_windowHandle.get(), 0, 0)) != 0) | ||
// Message loop, exits when the window handle has been destroyed | ||
while (m_windowThreadShouldRun.load()) |
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.
nit: do we need the load()
…tMessage to block instead of polling
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.
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.
#include <AppInstallerRuntime.h> | ||
#include <winget/COMStaticStorage.h> | ||
|
||
using namespace std::chrono_literals; |
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.
nit: not needed anymore?
Ports #5781 to the 1.11 branch.
Change
Shut down the window thread as part of the
TerminationSignalHandler
destruction.Properly unregister the window class after destroying the window on the thread.
Signal the shutdown via an
atomic_bool
.Microsoft Reviewers: Open in CodeFlow