RFR (S): Fix for JDK-6546236 made Solaris os::yield() a no-op

Frederic Parain frederic.parain at oracle.com
Mon Jul 7 12:08:18 UTC 2014


Greetings,

Fix for JDK-6546236 merged the Solaris os::sleep() implementation with 
the shared POSIX implementation. However, Solaris code used to call 
os:sleep(Thread::current(), 0, false) to implement os::yield(), and the 
os::posix::sleep() method returns immediately if its time argument is 
zero, which makes the Solaris os::yield() method a no-op.

This changeset fixes that with other clean up:

   1) Solaris os::yield() was changed to call NakedYield() instead
      of os:sleep(Thread::current(), 0, false). I made this change
      to make its implementation consistent with other POSIX
      platform and also because the change of os::yield() into
      a no-op didn't show any regression (so, the short sleep
      required in the past doesn't look necessary anymore).

   2) Once Solaris os::yield() has been changed to call NakedYield()
      the JVM had two different methods to call the yield system
      call: os::yield() and os::NakedYield(). I replaced those
      methods with a new method called os::naked_yield(). This
      renaming aims to: avoid confusion with the old os::yield()
      methods and its weird implementation and fix naming style
      of os::NakedYield() method.

   3) I removed the unused enum type YieldResult, which only
      matters on the Windows platform but it isn't used anywhere.


Bug URL: https://bugs.openjdk.java.net/browse/JDK-8047714

Webrev: http://cr.openjdk.java.net/~fparain/8047714/webrev.00/


Thanks,

Fred

-- 
Frederic Parain - Oracle
Grenoble Engineering Center - France
Phone: +33 4 76 18 81 17
Email: Frederic.Parain at oracle.com


More information about the hotspot-runtime-dev mailing list