mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
problem: TryAcquireSRWLockExclusive requires Windows 7 :/. solution kinda: use std::recursive_mutex (CriticalSection on windows) where try_lock is used. Dolphin should work on Vista x64 again.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7313 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -96,8 +96,8 @@ public:
|
||||
#ifdef _WIN32
|
||||
#ifdef USE_SRWLOCKS
|
||||
SleepConditionVariableSRW(&m_handle, lock.mutex()->native_handle(), INFINITE, 0);
|
||||
#elif USE_CONDITION_VARIABLES
|
||||
SleepConditionVariableCS(m_handle, lock.mutex()->native_handle(), INFINITE);
|
||||
#elif defined(USE_CONDITION_VARIABLES)
|
||||
SleepConditionVariableCS(&m_handle, lock.mutex()->native_handle(), INFINITE);
|
||||
#else
|
||||
// TODO: broken, the unlock and wait need to be atomic
|
||||
lock.unlock();
|
||||
|
@ -157,14 +157,15 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
bool try_lock()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return (0 != TryAcquireSRWLockExclusive(&m_handle));
|
||||
#else
|
||||
return !pthread_mutex_trylock(&m_handle);
|
||||
#endif
|
||||
}
|
||||
// TryAcquireSRWLockExclusive requires Windows 7!!
|
||||
// bool try_lock()
|
||||
// {
|
||||
//#ifdef _WIN32
|
||||
// return (0 != TryAcquireSRWLockExclusive(&m_handle));
|
||||
//#else
|
||||
// return !pthread_mutex_trylock(&m_handle);
|
||||
//#endif
|
||||
// }
|
||||
|
||||
native_handle_type native_handle()
|
||||
{
|
||||
|
Reference in New Issue
Block a user