Fix a hang in linux with the wiimote new plugin caused by a critical section not being exited. Also removed the original wiiuse_find function and replaced it with my wiiuse_find_more function with a little tweak to speed up wiimote discovery.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6007 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-07-30 18:55:36 +00:00
parent 6ed3357066
commit 87043879f8
3 changed files with 138 additions and 226 deletions

View File

@ -389,6 +389,7 @@ void Refresh() // this gets called from the GUI thread
// make sure real wiimotes have been initialized
if (!g_real_wiimotes_initialized)
{
g_refresh_critsec.Leave();
Initialize();
return;
}
@ -401,10 +402,13 @@ void Refresh() // this gets called from the GUI thread
// don't scan for wiimotes if we don't want any more
if (wanted_wiimotes <= g_wiimotes_found)
{
g_refresh_critsec.Leave();
return;
}
// scan for wiimotes
unsigned int num_wiimotes = wiiuse_find_more(g_wiimotes_from_wiiuse, wanted_wiimotes, 5);
unsigned int num_wiimotes = wiiuse_find(g_wiimotes_from_wiiuse, wanted_wiimotes, 5);
DEBUG_LOG(WIIMOTE, "Found %i Real Wiimotes, %i wanted", num_wiimotes, wanted_wiimotes);