SocketThreads: proper thread finishing sequence (doesn't trigger AppVerifier checks :)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@419 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
cbfca006f7
commit
f72d1e1821
@ -226,6 +226,15 @@ cSocketThreads::cSocketThread::cSocketThread(cSocketThreads * a_Parent) :
|
|||||||
cSocketThreads::cSocketThread::~cSocketThread()
|
cSocketThreads::cSocketThread::~cSocketThread()
|
||||||
{
|
{
|
||||||
m_ShouldTerminate = true;
|
m_ShouldTerminate = true;
|
||||||
|
|
||||||
|
// Notify the thread:
|
||||||
|
ASSERT(m_ControlSocket2.IsValid());
|
||||||
|
m_ControlSocket2.Send("a", 1);
|
||||||
|
|
||||||
|
// Wait for the thread to finish:
|
||||||
|
Wait();
|
||||||
|
|
||||||
|
// Close the control sockets:
|
||||||
m_ControlSocket1.CloseSocket();
|
m_ControlSocket1.CloseSocket();
|
||||||
m_ControlSocket2.CloseSocket();
|
m_ControlSocket2.CloseSocket();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user