Fix calling thread::waitfordeath twice in usbgecko/gba

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6871 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2011-01-17 08:31:19 +00:00
parent fdd56f4621
commit d0805aef37
2 changed files with 9 additions and 20 deletions

View File

@ -17,7 +17,7 @@
#include "EXI_Device.h"
#include "EXI_DeviceGecko.h"
//#pragma optimize("",off)
THREAD_RETURN ClientThreadFunc(void *arg)
{
((GeckoSockServer*)arg)->ClientThread();
@ -40,18 +40,16 @@ GeckoSockServer::GeckoSockServer()
GeckoSockServer::~GeckoSockServer()
{
if (client_running)
{
if (clientThread)
--client_count;
client_running = false;
clientThread->WaitForDeath();
}
delete clientThread;
clientThread = NULL;
if (--client_count <= 0)
if (client_count <= 0)
{
server_running = false;
connectionThread->WaitForDeath();
delete connectionThread;
connectionThread = NULL;
}
@ -94,12 +92,8 @@ bool GeckoSockServer::GetAvailableSock(sf::SocketTCP &sock_to_fill)
{
sock_to_fill = waiting_socks.front();
if (clientThread)
{
if (client_running)
{
client_running = false;
clientThread->WaitForDeath();
}
delete clientThread;
clientThread = NULL;
}
@ -209,4 +203,3 @@ void CEXIGecko::ImmReadWrite(u32 &_uData, u32 _uSize)
break;
}
}
//#pragma optimize("",on)

View File

@ -60,12 +60,8 @@ THREAD_RETURN GBAConnectionWaiter(void*)
void GBAConnectionWaiter_Shutdown()
{
server_running = false;
if (connectionThread)
{
connectionThread->WaitForDeath();
delete connectionThread;
connectionThread = NULL;
}
}
bool GetAvailableSock(sf::SocketTCP& sock_to_fill)