RFR: 8299343: Windows: Invalid thread_native_entry declaration

Kim Barrett kbarrett at openjdk.org
Mon Dec 26 23:37:50 UTC 2022


On Mon, 26 Dec 2022 16:22:55 GMT, Julian Waters <jwaters at openjdk.org> wrote:

> Why do we want/need this to be a C++ static member function? The thread entry points are always plain C functions.

As discussed in the bug report, it needs to be a static member function
because it refers to private members of os::win32.  The alternatives are also
discussed in the bug.

Of the various alternatives, this seems best to me.  There's no difference
between a static member function and a non-member function, other than scope
and access rules.

And referring to the definitions for the other platforms as "plain C
functions" is something of a misnomer; they are file-scoped C++ functions. It
just so happens that's sufficient on those platforms. To make them actually be
"plain C functions" would involve `extern "C"` linkage specifications, which
may, in particular, indicate a different (from C++) calling convention.

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

PR: https://git.openjdk.org/jdk/pull/11787


More information about the hotspot-runtime-dev mailing list