mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Replaced Common::CriticalSection with a std::mutex implementation. 64bit Windows builds now use SRWLocks and ConditionVariables(requires Vista/7, x64 builds will no longer work on Windows XP x64). Tell me if you hate that. Removed Common::EventEx. Common::Event now uses a std::condition_variable impl.(using ConditionVariables on Windows x64, Events on x86, or posix condition variables elsewhere). I experience slight speed improvements with these changes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7294 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -42,7 +42,6 @@ CLogWindow::CLogWindow(CFrame *parent, wxWindowID id, const wxPoint& pos,
|
||||
, x(0), y(0), winpos(0)
|
||||
, Parent(parent) , m_LogAccess(true)
|
||||
, m_Log(NULL), m_cmdline(NULL), m_FontChoice(NULL)
|
||||
, m_LogSection(1)
|
||||
, m_SJISConv(wxT(""))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
@ -212,11 +211,12 @@ void CLogWindow::OnClear(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
m_Log->Clear();
|
||||
|
||||
m_LogSection.Enter();
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_LogSection);
|
||||
int msgQueueSize = (int)msgQueue.size();
|
||||
for (int i = 0; i < msgQueueSize; i++)
|
||||
msgQueue.pop();
|
||||
m_LogSection.Leave();
|
||||
}
|
||||
|
||||
m_LogManager->getConsoleListener()->ClearScreen();
|
||||
}
|
||||
@ -308,7 +308,8 @@ void CLogWindow::UpdateLog()
|
||||
|
||||
m_LogTimer->Stop();
|
||||
|
||||
m_LogSection.Enter();
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_LogSection);
|
||||
int msgQueueSize = (int)msgQueue.size();
|
||||
for (int i = 0; i < msgQueueSize; i++)
|
||||
{
|
||||
@ -348,16 +349,16 @@ void CLogWindow::UpdateLog()
|
||||
}
|
||||
msgQueue.pop();
|
||||
}
|
||||
m_LogSection.Leave();
|
||||
} // unlock log
|
||||
|
||||
m_LogTimer->Start(UPDATETIME);
|
||||
}
|
||||
|
||||
void CLogWindow::Log(LogTypes::LOG_LEVELS level, const char *text)
|
||||
{
|
||||
m_LogSection.Enter();
|
||||
std::lock_guard<std::mutex> lk(m_LogSection);
|
||||
|
||||
if (msgQueue.size() >= 100)
|
||||
msgQueue.pop();
|
||||
msgQueue.push(std::pair<u8, wxString>((u8)level, wxString(text, m_SJISConv)));
|
||||
m_LogSection.Leave();
|
||||
}
|
||||
|
Reference in New Issue
Block a user