示例#1
0
文件: JThread.cpp 项目: luoxizhi/JLib
JThread::~JThread()
{
	if( m_handle ){
		WaitForThreadEnd();
		::CloseHandle(m_handle);
		m_handle = NULL;
	}
}
示例#2
0
void EndOfSMTP ()
{
	// 等待所有线程执行完毕
	for ( int i=0; i<g_PtrAry_Threads.GetSize(); i++ )
	{
		HANDLE hThread = (HANDLE)g_PtrAry_Threads.GetAt(i);
		if ( HANDLE_IS_VALID(hThread) )
		{
			WaitForThreadEnd ( &hThread, 30*1000 );
		}
	}
	g_PtrAry_Threads.RemoveAll ();
}
示例#3
0
文件: JThread.cpp 项目: luoxizhi/JLib
JTimer::~JTimer()
{
	m_event.SetEvent();
	WaitForThreadEnd();
}
示例#4
0
文件: JSocket.cpp 项目: luoxizhi/JLib
JUdpSocket::~JUdpSocket()
{
	WaitForThreadEnd();
	Close();
	::WSACleanup();
}
示例#5
0
文件: JSocket.cpp 项目: luoxizhi/JLib
JTcpServer::~JTcpServer()
{
	WaitForThreadEnd();
	::WSACleanup();
}