8299343: Windows: Invalid thread_native_entry declaration

Reviewed-by: dholmes, iklam
This commit is contained in:
Kim Barrett 2023-01-05 22:02:45 +00:00
parent 3e2314d082
commit dfdbd0fe7f
2 changed files with 9 additions and 4 deletions
src/hotspot/os/windows

@ -510,8 +510,10 @@ struct tm* os::gmtime_pd(const time_t* clock, struct tm* res) {
JNIEXPORT
LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo);
// Thread start routine for all newly created threads
static unsigned __stdcall thread_native_entry(Thread* thread) {
// Thread start routine for all newly created threads.
// Called with the associated Thread* as the argument.
unsigned __stdcall os::win32::thread_native_entry(void* t) {
Thread* thread = static_cast<Thread*>(t);
thread->record_stack_base_and_size();
thread->initialize_thread_current();
@ -744,7 +746,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
thread_handle =
(HANDLE)_beginthreadex(NULL,
(unsigned)stack_size,
(unsigned (__stdcall *)(void*)) thread_native_entry,
&os::win32::thread_native_entry,
thread,
initflag,
&thread_id);

@ -36,7 +36,6 @@ typedef void (*signal_handler_t)(int);
class os::win32 {
friend class os;
friend unsigned __stdcall thread_native_entry(Thread*);
protected:
static int _processor_type;
@ -70,6 +69,10 @@ class os::win32 {
static HINSTANCE load_Windows_dll(const char* name, char *ebuf, int ebuflen);
private:
// The handler passed to _beginthreadex().
// Called with the associated Thread* as the argument.
static unsigned __stdcall thread_native_entry(void*);
enum Ept { EPT_THREAD, EPT_PROCESS, EPT_PROCESS_DIE };
// Wrapper around _endthreadex(), exit() and _exit()
static int exit_process_or_thread(Ept what, int exit_code);