mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-04 11:43:47 +01:00
Windows: Prevent hang on shutdown.
Which may occur on ARM64 or perhaps lower thread processors? Let's avoid spinloops.
This commit is contained in:
1 parent
83272c5e25
commit
c66d5dcac1
3 files changed
+22
-6
No files matched your search
@@ -854,6 +854,21 @@ CAPTUREDEVIDE_MESSAGE WindowsCaptureDevice::getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
void WindowsCaptureDevice::updateState(const CAPTUREDEVIDE_STATE &newState) {
|
||||
std::unique_lock<std::mutex> guard(stateMutex_);
|
||||
state = newState;
|
||||
stateCond_.notify_all();
|
||||
}
|
||||
|
||||
void WindowsCaptureDevice::waitShutDown() {
|
||||
sendMessage({ CAPTUREDEVIDE_COMMAND::SHUTDOWN, nullptr });
|
||||
|
||||
std::unique_lock<std::mutex> guard(stateMutex_);
|
||||
while (!isShutDown()) {
|
||||
stateCond_.wait(guard);
|
||||
}
|
||||
}
|
||||
|
||||
void WindowsCaptureDevice::messageHandler() {
|
||||
CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
MFStartup(MF_VERSION);
|
||||
|
||||
Reference in new issue
Block a user