mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 02:29:59 -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:
@ -65,7 +65,7 @@ void GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
// wtf is this?
|
||||
_pPADStatus->button = PAD_USE_ORIGIN;
|
||||
|
||||
std::unique_lock<std::mutex> lk(g_plugin.controls_lock, std::try_to_lock);
|
||||
std::unique_lock<std::recursive_mutex> lk(g_plugin.controls_lock, std::try_to_lock);
|
||||
|
||||
if (!lk.owns_lock())
|
||||
{
|
||||
@ -97,7 +97,7 @@ void GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
//
|
||||
void Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(g_plugin.controls_lock, std::try_to_lock);
|
||||
std::unique_lock<std::recursive_mutex> lk(g_plugin.controls_lock, std::try_to_lock);
|
||||
|
||||
if (lk.owns_lock())
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ void Update(int _number)
|
||||
//PanicAlert( "Wiimote_Update" );
|
||||
|
||||
// TODO: change this to a try_to_lock, and make it give empty input on failure
|
||||
std::lock_guard<std::mutex> lk(g_plugin.controls_lock);
|
||||
std::lock_guard<std::recursive_mutex> lk(g_plugin.controls_lock);
|
||||
|
||||
static int _last_number = 4;
|
||||
if (_number <= _last_number)
|
||||
|
Reference in New Issue
Block a user