vtkTimeStamp & itkTimeStamp atomic increment optimisation and cleanup patch
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
After profiling our application, we discovered that significant time is spent in vtkTimeStamp::Modified(). Time was lost because a mutex was being taken to safely increment an integer. A mutex is a fairly expensive construct. A Windows-only optimisation exists in the code that uses the InterlockedIncrement() API to atomically increment the number without the need for a mutex. Mac OS X has a similar API.
- makes the analogous optimisation on Mac OS (10.4 and later only) in both vtk and itk
- adds the Windows optimisation to the ITK version of TimeStamp
- changed the return type of operator> and operator< from int to bool
- other misc changes to make the two classes less divergent (added consts, etc.)
I have been using this code for weeks now on Mac OS X 10.5 in both 32 and 64 bit, and it seems just fine. I have not tested on other OSes however.
I could commit this myself, but I would appreciate someone review the changes first.