No thread safety in clock_gettime (hires_ns::prime)

Mon Nov 26 17:38:00 GMT 2018

On Mon, 26 Nov 2018 18:01:40, Corinna Vinschen  wrote:
> On Nov 23 11:27, James E. King III wrote:

> > I found that a call to
> > clock_gettime(CLOCK_MONOTONIC, ..) has a one-time initialization that
> > is not thread-safe.  If two threads call this at the same time, they
> > will race.  The results I am seeing are typically that one of the two
> > callers get a timespec structure with zero values, and no error return
> > code from the call.
> Thanks for the testcase, but I can't reproduce the problem, neither on
> 32 bit nor on 64 bit.  I tweaked your makefile to have a 100K loop I
> started multiple times with differently optimzed code, but to no avail.

I can, easily. (Windows 7, 64-bits. Unmodified Makefile.)


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list