Bug in vtkMultiThreader.cxx
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
There is a mistake in vtkMultiThreader.cxx when testing Win32 CreateThread result :
#ifdef VTK_USE_WIN32_THREADS DWORD threadId; HANDLE process_id[VTK_MAX_THREADS]; #endif
//...
process_id[thread_loop] =
CreateThread(NULL, 0, this->MultipleMethod[thread_loop],
((void *)(&this->ThreadInfoArray[thread_loop])), 0, &threadId);
if (process_id == NULL)
{
vtkErrorMacro("Error in thread creation !!!");
}
The test if (process_id == NULL) is wrong (process_id can't be NULL), the right test is : if (process_id[thread_loop] == NULL)
This error is present twice : line 259 line 449
One can also note that threadId is passed to CreateThread but is never used. According to the documentation of CreateThread, threadId can be omitted and removed of the source.
Greets, Aurelien REGAT-BARREL