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

David Holmes david.holmes at oracle.com
Sat May 20 13:07:26 UTC 2017


Hi Robbin,

On 19/05/2017 10:33 PM, Robbin Ehn wrote:

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/

Thanks for the taking the time to do this.

This makes the calculation independent of source/unit.

Okay I see. Took me a few read throughs to get the gist of it - and it helps to read from the bottom functions up :)

Not sure why you are returning a value from the functions though ??

Let's see what others think. It's somewhat harder to compare against the existing code.

Thanks again. David

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