mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Don't hold the lock when processing messages, only when taking them off the queue. Fixes #10383
This commit is contained in:
parent
36d61c3595
commit
27227f87fd
1 changed files with 7 additions and 4 deletions
|
@ -942,15 +942,18 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
|
|||
void NativeUpdate() {
|
||||
PROFILE_END_FRAME();
|
||||
|
||||
std::vector<PendingMessage> toProcess;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(pendingMutex);
|
||||
for (size_t i = 0; i < pendingMessages.size(); i++) {
|
||||
HandleGlobalMessage(pendingMessages[i].msg, pendingMessages[i].value);
|
||||
screenManager->sendMessage(pendingMessages[i].msg.c_str(), pendingMessages[i].value.c_str());
|
||||
}
|
||||
toProcess = std::move(pendingMessages);
|
||||
pendingMessages.clear();
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < toProcess.size(); i++) {
|
||||
HandleGlobalMessage(toProcess[i].msg, toProcess[i].value);
|
||||
screenManager->sendMessage(toProcess[i].msg.c_str(), toProcess[i].value.c_str());
|
||||
}
|
||||
|
||||
g_DownloadManager.Update();
|
||||
screenManager->update();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue