File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
test/jdk/jdk/jfr/event/profiling Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 3939 * @run main/timeout=480 jdk.jfr.event.profiling.TestCPUTimeSampleMultipleRecordings
4040 */
4141public class TestCPUTimeSampleMultipleRecordings {
42-
43- static String nativeEvent = EventNames .CPUTimeSample ;
44-
4542 static volatile boolean alive = true ;
4643
4744 public static void main (String [] args ) throws Exception {
4845 Thread t = new Thread (TestCPUTimeSampleMultipleRecordings ::nativeMethod );
49- t .setDaemon (true );
5046 t .start ();
5147 for (int i = 0 ; i < 2 ; i ++) {
5248 try (RecordingStream rs = new RecordingStream ()) {
53- rs .enable (nativeEvent ).with ("throttle" , "1ms" );
54- rs .onEvent (nativeEvent , e -> {
55- alive = false ;
49+ rs .enable (EventNames .CPUTimeSample ).with ("throttle" , "1ms" );
50+ rs .onEvent (EventNames .CPUTimeSample , e -> {
5651 rs .close ();
5752 });
5853
5954 rs .start ();
6055 }
6156 }
6257 alive = false ;
58+ t .join ();
6359 }
6460
6561 public static void nativeMethod () {
You can’t perform that action at this time.
0 commit comments