Skip to content

Commit 04a4d34

Browse files
committed
8297006: JFR: AbstractEventStream should not hold thread instance
Reviewed-by: mgronlun
1 parent 5db1b58 commit 04a4d34

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/AbstractEventStream.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2022, 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
@@ -62,7 +62,6 @@ public abstract class AbstractEventStream implements EventStream {
6262
private final StreamConfiguration streamConfiguration = new StreamConfiguration();
6363
private final List<Configuration> configurations;
6464
private final ParserState parserState = new ParserState();
65-
private volatile Thread thread;
6665
private Dispatcher dispatcher;
6766
private boolean daemon = false;
6867

@@ -214,14 +213,13 @@ protected final ParserState parserState() {
214213
public final void startAsync(long startNanos) {
215214
startInternal(startNanos);
216215
Runnable r = () -> run(accessControllerContext);
217-
thread = SecuritySupport.createThreadWitNoPermissions(nextThreadName(), r);
216+
Thread thread = SecuritySupport.createThreadWitNoPermissions(nextThreadName(), r);
218217
SecuritySupport.setDaemonThread(thread, daemon);
219218
thread.start();
220219
}
221220

222221
public final void start(long startNanos) {
223222
startInternal(startNanos);
224-
thread = Thread.currentThread();
225223
run(accessControllerContext);
226224
}
227225

0 commit comments

Comments
 (0)