Skip to content

Commit fab2d34

Browse files
committed
allow wrong phase during shutdown
1 parent 4856344 commit fab2d34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ setThreadLocalStorage(jthread thread, ThreadNode *node)
170170
return;
171171
}
172172
}
173+
if (error == JVMTI_ERROR_WRONG_PHASE && gdata->vmDead && isVThread(thread)) {
174+
// Just return. This can happen with vthreads when the vm is exiting.
175+
return;
176+
}
173177
if (error != JVMTI_ERROR_NONE) {
174178
// The jthread object must be valid, so this must be a fatal error.
175179
EXIT_ERROR(error, "cannot set thread local storage");

0 commit comments

Comments
 (0)