mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 20:58:54 +00:00
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:
parent
1b583a0441
commit
0cc8eda124
4 changed files with 14 additions and 12 deletions
|
@ -157,15 +157,17 @@ public:
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
// TryAcquireSRWLockExclusive requires Windows 7!!
|
||||
// bool try_lock()
|
||||
// {
|
||||
//#ifdef _WIN32
|
||||
// return (0 != TryAcquireSRWLockExclusive(&m_handle));
|
||||
//#else
|
||||
// return !pthread_mutex_trylock(&m_handle);
|
||||
//#endif
|
||||
// }
|
||||
bool try_lock()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return (0 != TryAcquireSRWLockExclusive(&m_handle));
|
||||
#else
|
||||
return !pthread_mutex_trylock(&m_handle);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
native_handle_type native_handle()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue