Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8278309: [windows] use of uninitialized OSThread::_state
Reviewed-by: mdoerr
Backport-of: 54993b13078ceb05736bb0e1d7ed7415c390442e
  • Loading branch information
tstuefe committed Dec 20, 2021
1 parent 86c2995 commit b07b90f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hotspot/os/windows/os_windows.cpp
Expand Up @@ -610,6 +610,9 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
return false;
}

// Initial state is ALLOCATED but not INITIALIZED
osthread->set_state(ALLOCATED);

// Initialize support for Java interrupts
HANDLE interrupt_event = CreateEvent(NULL, true, false, NULL);
if (interrupt_event == NULL) {
Expand Down Expand Up @@ -701,7 +704,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
osthread->set_thread_handle(thread_handle);
osthread->set_thread_id(thread_id);

// Initial thread state is INITIALIZED, not SUSPENDED
// Thread state now is INITIALIZED, not SUSPENDED
osthread->set_state(INITIALIZED);

// The thread is returned suspended (in state INITIALIZED), and is started higher up in the call chain
Expand Down

1 comment on commit b07b90f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.