Skip to content

Commit 4d6a8cc

Browse files
committed
Fix scope of the try block
1 parent 05d861c commit 4d6a8cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/hotspot/jtreg/serviceability/dcmd/thread/PrintMountedVirtualThread.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ public void run(CommandExecutor executor) throws InterruptedException {
4444
var shouldFinish = new AtomicBoolean(false);
4545
var started = new CountDownLatch(1);
4646
final Runnable runnable = new DummyRunnable(shouldFinish, started);
47-
Thread vthread = Thread.ofVirtual().name("Dummy Vthread").start(runnable);
48-
started.await();
49-
/* Execute */
50-
OutputAnalyzer output = executor.execute("Thread.print");
5147
try {
48+
Thread vthread = Thread.ofVirtual().name("Dummy Vthread").start(runnable);
49+
started.await();
50+
/* Execute */
51+
OutputAnalyzer output = executor.execute("Thread.print");
5252
output.shouldMatch(".*at " + Pattern.quote(DummyRunnable.class.getName()) + "\\.run.*");
5353
output.shouldMatch(".*at " + Pattern.quote(DummyRunnable.class.getName()) + "\\.compute.*");
5454
output.shouldMatch("Mounted virtual thread " + "\"Dummy Vthread\"" + " #" + vthread.threadId());

0 commit comments

Comments
 (0)