Hi David
On 05/19/2017 01:36 PM, David Holmes wrote:
There are three different forms of the calculation. The two relative time versions use a different time function and so a different time structure (timeval vs timespec)
and a different calculation.
Yes that's why I included unit in my example signature.
It's more complicated than that because we may have build time
SUPPORTS_CLOCK_MONOTONIC but we still need the runtime check as well.
to_abstime is the old linux unpackTime with the addition of the build time
conditionals.
I'm not changing that, I'm not sure how to explain better,
so here is the patch (only compiled and silly naming convention):
http://cr.openjdk.java.net/~rehn/8174231/webrev/
This makes the calculation independent of source/unit.
Thanks!
/Robbin
David
David
-----
I do not see a problem with this, only better readability?
/Robbin
Thanks,
David
-----
struct timespec now;
int status = _clock_gettime(CLOCK_MONOTONIC, &now);
assert_status(status == 0, status, "clock_gettime");
calc_time(abstime, timeout, isAbsolute, now.tv_sec, now.tv_nsec,
NANOUNITS);
} else {
#else
{
#endif
struct timeval now;
int status = gettimeofday(&now, NULL);
assert(status == 0, "gettimeofday");
calc_time(abstime, timeout, isAbsolute, now.tv_sec, now.tv_usec,
MICROUNITS);
}
#endif
Thanks for fixing this!
/Robbin