Permalink
Browse files

Don't hold the lock when processing messages, only when taking them o…

…ff the queue. Fixes #10383
  • Loading branch information...
hrydgard committed Dec 10, 2017
1 parent 36d61c3 commit 27227f87fde14ead3cdeb52c690edacbedee4a65
Showing with 7 additions and 4 deletions.
  1. +7 −4 UI/NativeApp.cpp
@@ -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();
}

1 comment on commit 27227f8

@tausifj15

This comment has been minimized.

tausifj15 commented on 27227f8 Dec 10, 2017

Sir please fix frame drop for snapdragon 435 adreno 505 device my device is redmi 4x/4 please sir

Please sign in to comment.