Re-enable the std::mutex try_lock on linux and use it for the Host_GetKeyState keystate_lock mutex. This reduces the number of application crashes on linux during emulation.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7334 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2011-03-12 01:19:04 +00:00
parent 1b583a0441
commit 0cc8eda124
4 changed files with 14 additions and 12 deletions

View File

@ -584,8 +584,8 @@ bool Host_GetKeyState(int keycode)
#ifdef _WIN32
return GetAsyncKeyState(keycode);
#elif defined __WXGTK__
std::unique_lock<std::recursive_mutex> lk(main_frame->keystate_lock, std::try_to_lock);
if (!lk.owns_lock())
std::unique_lock<std::mutex> lk(main_frame->keystate_lock, std::defer_lock);
if (!lk.try_lock())
return false;
bool key_pressed;