Пример #1
0
void GProcThrd_Destroy(void)
{
	bGProcThrdThreadIsActive = FALSE;
	if(!pGProcThrdThreadAddr)
		return;

	PGTHREAD pThread;

	DWORD i;

	pThread = pGProcThrdThreadAddr;
	for(i = 0; i < dwGProcThrdThreadNumber; i++)
	{
		pThread->bIsShutdown = TRUE;
		pThread = pThread + 1;
	}
	
	for(i = 0; i < dwGProcThrdThreadNumber; i++)
		PostQueuedCompletionStatus(hGProcThrdThreadCompletionPort, 0, 0, NULL);
	
	pThread = pGProcThrdThreadAddr;
	for(i = 0; i < dwGProcThrdThreadNumber; i++)
	{
		GThrd_DestroyThread(pThread);
		pThread = pThread + 1;
	}

	GMem_Free(pGProcThrdThreadAddr);
	CloseHandle(hGProcThrdThreadCompletionPort);
	hGProcThrdThreadCompletionPort = 0;
	dwGProcThrdThreadNumber = 0;
	pGProcThrdThreadAddr = NULL;
}
Пример #2
0
void GTcpClt_EndThread(void)
{
	if(GTcpCltServiceThreadData.bIsShutdown)
	{
		GTcpCltServiceThreadData.bIsShutdown = TRUE;
		GLog_Write("GTcpClt_EndThread:正在关闭服务线程“GTcpCltServiceThread”");
		GThrd_DestroyThread(&GTcpCltServiceThreadData);
		GLog_Write("GTcpClt_EndThread:成功关闭服务线程“GTcpCltServiceThread”");
	}
}
Пример #3
0
void GTcpSvr_EndThread(void)
{
	if(!GTcpSvrServiceThreadData.bIsShutdown)
	{
		GTcpSvrServiceThreadData.bIsShutdown = TRUE;
		GLog_Write("GTcpSvr_EndThread:正在关闭服务线程");
		GThrd_DestroyThread(&GTcpSvrServiceThreadData);
		GLog_Write("GTcpSvr_EndThread:成功关闭服务线程");
	}
}