RFR [XS] : 8215707: [macosx] check return code of pthread_getschedparam

Baesken, Matthias matthias.baesken at sap.com
Thu Dec 20 09:21:53 UTC 2018

Hello,  while looking at the  thread  prio + scheduling handling in  hotspot, I noticed that  at one place  we seem to handle pthread_getschedparam  in a wrong way.

According to the API documentation, pthread_getschedparam returns an int which is 0 when successful, otherwise it is a value != 0.


"If successful, these functions return 0. Otherwise, an error number is returned to indicate the error."

At some places the return code of pthread_getschedparam is checked in the OpenJDK hotspot  sources, however at os::get_native_priority (os_bsd.cpp) it is not done, but should be added.
The current  coding handles the  function in a  getpriority-like way  (which might or might not work), but at least it is not what is documented in the API doc and done at other places in the coding.

Bug/webrev :



Thanks, Matthias

More information about the hotspot-dev mailing list