Skip to content

Commit 85ebfc8

Browse files
author
duke
committed
Backport 0e501f66dfc52a0e049d4fa39c1fcd24f1f2ee4b
1 parent 4a5c578 commit 85ebfc8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/hotspot/jtreg/vmTestbase/nsk/jvmti/StopThread/stopthrd007.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
2828
import nsk.share.*;
2929
import nsk.share.jvmti.*;
3030

31+
import java.util.concurrent.locks.LockSupport;
32+
3133
public class stopthrd007 extends DebugeeClass {
3234

3335
// run test from command line
@@ -66,6 +68,11 @@ public int runIt(String argv[], PrintStream out) {
6668
log = new Log(out, argHandler);
6769
timeout = argHandler.getWaitTime() * 60 * 1000;
6870

71+
// Unpark virtual threads to load jdk.internal.misc.VirtualThreads
72+
// and avoid NoClassDefFoundError if ThreadDeath is happen during unlock.
73+
Thread vt = Thread.startVirtualThread(LockSupport::park);
74+
LockSupport.unpark(vt);
75+
6976
log.display("Debugee started");
7077

7178
startingBarrier = new Wicket(3);

0 commit comments

Comments
 (0)