View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001045VTK(No Category)public2004-08-10 11:322011-01-13 17:00
ReporterAurĂ©lien Regat-Barrel 
Assigned ToMathieu Malaterre 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001045: Bug in vtkMultiThreader.cxx
DescriptionThere 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
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0001380)
Mathieu Malaterre (developer)
2004-08-16 13:22

$ cvs ci vtkMultiThreader.cxx /opt/VTK/VTK/Common
Checking in vtkMultiThreader.cxx;
/cvsroot/VTK/VTK/Common/vtkMultiThreader.cxx,v <-- vtkMultiThreader.cxx
new revision: 1.46; previous revision: 1.45
done

 Issue History
Date Modified Username Field Change
2010-11-29 17:59 Mathieu Malaterre Source_changeset_attached => VTK master 8a85ad18
2011-01-13 17:00 Source_changeset_attached => VTK master a2bd8391
2011-01-13 17:00 Source_changeset_attached => VTK master 020ef709
2011-06-16 13:11 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team