[vtk-developers] vtkSleep bug?
David Gobbi
david.gobbi at gmail.com
Thu Jan 27 15:24:01 EST 2011
I don't know who was responsible for the copy/paste, but the
original code from vtkVideoSource is mine. In my own defence,
when I wrote the code, OS X didn't exist.
Since you volunteered, there is probably a suitable kwsys function
that could be called instead, and if not, you can petition Kitware to
add one ;)
- David
On Thu, Jan 27, 2011 at 1:08 PM, Sean McBride <sean at rogue-research.com> wrote:
> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
More information about the vtk-developers
mailing list