Skip to content

WIP: Make all image GetDimensions() calls thread-safe

David Gobbi requested to merge dgobbi/vtk:image-dimensions into master

Previously, the Dimensions were computed from the Extent whenever GetDimensions() was called. This meant that the GetDimensions() signature that returned the pointer to the Dimensions ivar was not strictly thread-safe, since the ivar was written to on every call.

This change computes the Dimensions only when the Extent is set. Now all GetDimensions() calls are thread-safe, eliminating a potential source of thread-related bugs in VTK.

Note: If this change is accepted, then the same similar changes should be done for the other structured data sets (vtkStructuredGrid and vtkRectilinearGrid).

Edited by David Gobbi

Merge request reports