WaitForSingleObject(S_Full, INFINITE);/*处理缓冲-1*/
if(nTaskNum > THREAD_POOL_SIZE)
{
rc = WaitForMultipleObjects(THREAD_POOL_SIZE, hServiceThreads,FALSE,INFINITE);
slot = rc - WAIT_OBJECT_0;
}
if(!(hServiceThreads[slot++] = (HANDLE)_beginthread(SingleModelThread,0,NULL)))
{
printf("_beginthread error!");
return ;
}
ReleaseSemaphore(S_Empty, 1, NULL);/*输入缓冲+1*/
if(nTaskNum > THREAD_POOL_SIZE)
{
rc = WaitForMultipleObjects(THREAD_POOL_SIZE, hServiceThreads,FALSE,INFINITE);
slot = rc - WAIT_OBJECT_0;
}
if(!(hServiceThreads[slot++] = (HANDLE)_beginthread(SingleModelThread,0,NULL)))
{
printf("_beginthread error!");
return ;
}
ReleaseSemaphore(S_Empty, 1, NULL);/*输入缓冲+1*/