RFR: JDK-8262955: Unify os::fork_and_exec() across Posix platforms

Thomas Stuefe stuefe at openjdk.java.net
Fri Mar 5 16:56:14 UTC 2021


On Fri, 5 Mar 2021 16:14:03 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Hi Thomas,
>> Can the #includes of <sys/wait.h> be removed from the os_aix.cpp, os_bsd.cpp, and os_linux.cpp files?
>> Thanks, Harold
>
>> Hi Thomas,
>> Can the #includes of <sys/wait.h> be removed from the os_aix.cpp, os_bsd.cpp, and os_linux.cpp files?
>> Thanks, Harold
> 
> Yes, good catch, I'll remove them.

Hi,

I added the following changes:
- took care of Harold's request
- modified the coding to only use vfork when we are assured outside of signal context. For that, I added a marker into Thread which marks if the Thread is inside hotspot signal handling. If we want, we can use this in the future for better, signal handler aware tests (eg assert that we don't use malloc in tests).

I also added POSIX macros to macros.hpp since this is overdue. We can use those to replace constructs where we use #ifndef WINDOWS to guard posix coding. Seems cleaner that way to me.

Thanks, Thomas

-------------

PR: https://git.openjdk.java.net/jdk/pull/2810


More information about the hotspot-dev mailing list