![]() |
SpawnThreads() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Private Function |
Declared in: SocketThreadManager.h |
Declarationvoid SpawnThreads();
DescriptionSpawn the threads
Function Body
try
{
//Start creating threads
//Allocate the thread structure
m_pThreadData=new ThreadData[m_iThreadCount];
//And initialize it
memset(m_pThreadData,0,sizeof(ThreadData)*m_iThreadCount);
//Start spawning
for (int iCounter=0;iCounter<m_iThreadCount;++iCounter)
{
//Set our instance
m_pThreadData[iCounter].hInstance=m_hInstance;
//And create it
m_pThreadData[iCounter].hThreadHandle=CreateThread(NULL,
0,
SocketThread,
(LPVOID)(m_pThreadData+iCounter),
0,
&m_pThreadData[iCounter].dwThreadID);
//Check the thread has been created
if (!m_pThreadData[iCounter].hThreadHandle)
{
//Report the error
ReportError("SpawnThreads","Failed to create thread!");
return;
}
}
}
ERROR_HANDLER("SpawnThreads")
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 24 Apr 2001. |