(10) (M) RFR: 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems (original) (raw)

Robbin Ehn robbin.ehn at oracle.com
Fri May 19 12:33:46 UTC 2017


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 SUPPORTSCLOCKMONOTONIC but we still need the runtime check as well. toabstime 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 = clockgettime(CLOCKMONOTONIC, &now); assertstatus(status == 0, status, "clockgettime"); calctime(abstime, timeout, isAbsolute, now.tvsec, now.tvnsec, NANOUNITS); } else { #else { #endif struct timeval now; int status = gettimeofday(&now, NULL); assert(status == 0, "gettimeofday"); calctime(abstime, timeout, isAbsolute, now.tvsec, now.tvusec, MICROUNITS); } #endif Thanks for fixing this! /Robbin



More information about the hotspot-dev mailing list