Linux build fix.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6938 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-01-27 22:48:46 +00:00
parent 1c7ca86940
commit 198dcccfb0
2 changed files with 6 additions and 10 deletions

View File

@ -32,11 +32,13 @@
#include <assert.h> #include <assert.h>
int fd = -1; int fd = -1;
std::thread cpuThread;
bool CEXIETHERNET::deactivate() bool CEXIETHERNET::deactivate()
{ {
close(fd); close(fd);
fd = -1; fd = -1;
cpuThread.join();
return true; return true;
} }
@ -143,9 +145,8 @@ bool CEXIETHERNET::resume()
return true; return true;
} }
THREAD_RETURN CpuThread(void *pArg) void CpuThread(CEXIETHERNET *self)
{ {
CEXIETHERNET* self = (CEXIETHERNET*)pArg;
while(1) while(1)
{ {
if(self->CheckRecieved()) if(self->CheckRecieved())
@ -176,11 +177,9 @@ THREAD_RETURN CpuThread(void *pArg)
INFO_LOG(SP1, "Received %d bytes of data\n", self->mRecvBufferLength); INFO_LOG(SP1, "Received %d bytes of data\n", self->mRecvBufferLength);
self->mWaiting = false; self->mWaiting = false;
self->handleRecvdPacket(); self->handleRecvdPacket();
return 0;
} }
//sleep(1); //sleep(1);
} }
return 0;
} }
bool CEXIETHERNET::startRecv() bool CEXIETHERNET::startRecv()
@ -192,8 +191,7 @@ bool CEXIETHERNET::startRecv()
INFO_LOG(SP1, "already waiting\n"); INFO_LOG(SP1, "already waiting\n");
return true; return true;
} }
Common::Thread *cpuThread = new Common::Thread(CpuThread, (void*)this); cpuThread = std::thread(CpuThread, this);
if(cpuThread)
mWaiting = true; mWaiting = true;
return true; return true;

View File

@ -144,9 +144,7 @@ void DestroyXWindow(void)
{ {
XUnmapWindow(GLWin.dpy, GLWin.win); XUnmapWindow(GLWin.dpy, GLWin.win);
GLWin.win = 0; GLWin.win = 0;
if (GLWin.xEventThread) GLWin.xEventThread.join();
delete GLWin.xEventThread;
GLWin.xEventThread = NULL;
XFreeColormap(GLWin.evdpy, GLWin.attr.colormap); XFreeColormap(GLWin.evdpy, GLWin.attr.colormap);
} }