Menu

#424 *_timedwait use local time via _ftime while clock_gettime uses UTC

v1.0 (example)
closed-fixed
nobody
None
9
2015-01-20
2014-09-09
Luke-Jr
No

Old pthreads-win32 used GetSystemTimeAsFileTime (UTC) for *_timedwait. mingw-w64's winpthreads also uses GetSystemTimeAsFileTime (UTC) for clock_gettime. However, mingw-w64's *_timedwait compares the abstime with the local (not UTC) time retrieved by _ftime. This seems to me to be a serious bug in *_timedwait.

Furthermore, I notice the code is turning the abstime into a relative time. If this is interpreted by the OS in a monotonic way, *_timedwait really should fail unless the clock is specified as CLOCK_MONOTONIC.

Discussion

  • Kai Tietz

    Kai Tietz - 2014-09-17

    hmm, yes there might be something fishy. Could you provide me some documentation that timedwait API should be gm-time?

     
  • Kai Tietz

    Kai Tietz - 2015-01-20
    • status: open --> closed-fixed
     
  • Kai Tietz

    Kai Tietz - 2015-01-20

    Fixed on master at 1010ba215580ef8fc68b5f985b0e6bcf87305202

     

Log in to post a comment.

MongoDB Logo MongoDB