各位高手请指点一下啊!!谢谢!
多线程的问题
老是出现内存溢出,不知道是什么原因,请指点!!!谢谢!
void CVideoforward::InitSenders()
{
int i;
for(i=0;i<MAXSENDERNUM;i++)
{
this->G_Senders[i].used=0;
this->G_Senders[i].count=0;
this->G_Senders[i].front=0;
this->G_Senders[i].rear=0;
this->G_Senders[i].sendfd=-1;
InitializeCriticalSection(&(this->G_Senders[i].Cs_buf));
InitializeCriticalSection(&(this->G_Senders[i].Cs_count));
ZeroMemory(this->G_Senders[i].remoteip,20);
ZeroMemory(this->G_Senders[i].multicastip,20);
// _beginthread((void (__cdecl *)(void *))VideoSendFun,0,(void*)i);
if(pVideoSendFunThread[i])
TerminateThread(pVideoSendFunThread[i],0);
else
pVideoSendFunThread[i] = CreateThread(NULL,
0,
(LPTHREAD_START_ROUTINE)VideoSendFun,
NULL);
} this,
0,
}