From d1007097adfab66699bf71d2af78c4cd91338409 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Tue, 28 Aug 2018 16:26:19 -0400 Subject: [PATCH] actual performance improvement --- GUI/host/textthread.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GUI/host/textthread.cc b/GUI/host/textthread.cc index 8c665c1..ac7c3d1 100644 --- a/GUI/host/textthread.cc +++ b/GUI/host/textthread.cc @@ -35,15 +35,17 @@ void TextThread::Flush() sentence = std::wstring(converted, MultiByteToWideChar(status & USING_UTF8 ? CP_UTF8 : 932, 0, buffer.data(), buffer.size(), converted, buffer.size())); delete[] converted; } + ttMutex.unlock(); AddSentence(sentence); + ttMutex.lock(); memset(buffer.data(), 0, buffer.size()); buffer.clear(); } void TextThread::AddSentence(std::wstring sentence) { - LOCK ttLock(ttMutex); if (Output) sentence = Output(this, sentence); + LOCK ttLock(ttMutex); storage.append(sentence); }