RFR: 8299343: Windows: Invalid thread_native_entry declaration
David Holmes
dholmes at openjdk.org
Tue Dec 27 02:22:49 UTC 2022
On Mon, 26 Dec 2022 23:35:11 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> And referring to the definitions for the other platforms as "plain C functions" is something of a misnomer;
Perhaps, but the thread creation functions (_beginthreadex and pthread_create) are themselves plain C API's not C++. It seems to me that the fact a static C++ member function is equivalent to a static C++ non-member function here and both work, is itself the fortuitous accident. If there were indeed an issue with C++ versus C calling convention then we would need to switch to the C convention.
I agree it is nicer from an encapsulation pov that these are member functions, but when we are using thread creation routines that are extra-lingua we have to expect to make some concessions.
I don't object to the proposed approach as long as it works, but I would have gone for a different option that keeps these routines more C-like and provide a public os::win32 function for the thread entry code to use.
-------------
PR: https://git.openjdk.org/jdk/pull/11787
More information about the hotspot-runtime-dev
mailing list