Hi:
my way to synchronize is:
g_iThreads
BOOL threadproc(...)
{
g_iThreads--;
return true;
}
but if the application exit between g_iThreads--and return true.It may cause memory leak.isn't it?
It seems that to use WaitForMultipleObjects will be well.but I don't know that if there is an NULL in the HANDLE array of threads will it work as well.For example:the element 1 and 3 of the array is valid,and 2 is NULL.