Skip to content

Commit b07b90f

Browse files
committed
8278309: [windows] use of uninitialized OSThread::_state
Reviewed-by: mdoerr Backport-of: 54993b13078ceb05736bb0e1d7ed7415c390442e
1 parent 86c2995 commit b07b90f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hotspot/os/windows/os_windows.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,9 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
610610
return false;
611611
}
612612

613+
// Initial state is ALLOCATED but not INITIALIZED
614+
osthread->set_state(ALLOCATED);
615+
613616
// Initialize support for Java interrupts
614617
HANDLE interrupt_event = CreateEvent(NULL, true, false, NULL);
615618
if (interrupt_event == NULL) {
@@ -701,7 +704,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
701704
osthread->set_thread_handle(thread_handle);
702705
osthread->set_thread_id(thread_id);
703706

704-
// Initial thread state is INITIALIZED, not SUSPENDED
707+
// Thread state now is INITIALIZED, not SUSPENDED
705708
osthread->set_state(INITIALIZED);
706709

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

0 commit comments

Comments
 (0)