[vtk-developers] vtkSleep bug?

Sean McBride sean at rogue-research.com
Thu Jan 27 15:08:12 EST 2011


Hi all,

In TestConditionVariable.cxx, vtkGeoSource.cxx, and vtkVideoSource.cxx
the following function has been copy/pasted.

static inline void vtkSleep(double duration)
{
  duration = duration; // avoid warnings
  // sleep according to OS preference
#ifdef _WIN32
  Sleep((int)(1000*duration));
#elif defined(__FreeBSD__) || defined(__linux__) || defined(sgi)
  struct timespec sleep_time, dummy;
  sleep_time.tv_sec = (int)duration;
  sleep_time.tv_nsec = (int)(1000000000*(duration-sleep_time.tv_sec));
  nanosleep(&sleep_time,&dummy);
#endif
}


1) Is there a some kind of utilities file this could move to?

2) Is it deliberate that this is a no op on Mac OS? :)

Thanks,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list