JDK-8134537 : Much nearly duplicated code for sun.misc.Signal support
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-08-26
  • Updated: 2018-05-30
  • Resolved: 2018-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b15Fixed
Related Reports
Relates :  
Relates :  
Description
For Linux, Solaris, BSD, and AIX the implementations of os::user_handler, os::signal, os::signal_raise, and os::sigexitnum_pd are very similar, and some of the differences are probably unnecessary or even incorrect. [Solaris seems to be different in possibly slightly more interesting ways than the others, but even there it may be that "modern" Solaris could allow some of those differences to be removed.]

I think these could be mostly merged into a single implementation in os_posix.

Comments
PASE is the AIX emulation layer on IBM iseries aka good old AS/400. SAP supports it since we still have customers on it.
18-05-2018

They are mostly duplicated except on AIX Pase, whatever that is. // On AIX, we use sem_init(), sem_post(), sem_wait() // On Pase, we need to use msem_lock() and msem_unlock(), because Posix Semaphores // do not seem to work at all on PASE (unimplemented, will cause SIGILL). // Note that just using msem_.. APIs for both PASE and AIX is not an option either, as // on AIX, msem_..() calls are suspected of causing problems. There are also subtle differences that seem meaningful on Solaris. Other than that, this code is mostly the same, but I think it would be difficult and not worth the effort to consolidate for a deprecated feature. The jvm_{linux,aix,bsd,solaris}.cpp files are almost exactly the same so worth consolidating.
16-05-2018