File tree 1 file changed +3
-7
lines changed
src/jdk.jfr/share/classes/jdk/jfr/internal/periodic
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,7 @@ private void groupTasksIntoBatches(List<PeriodicTask> tasks) {
63
63
}
64
64
for (PeriodicTask task : activeSortedTasks (tasks )) {
65
65
if (task .isSchedulable ()) {
66
- Batch batch = task .getBatch ();
67
- // If new task, or period has changed, find new batch
68
- if (batch == null ) {
69
- batch = findBatch (task .getPeriod ());
70
- }
66
+ Batch batch = findBatch (task .getPeriod (), task .getBatch ());
71
67
batch .add (task );
72
68
}
73
69
}
@@ -89,7 +85,7 @@ private List<PeriodicTask> activeSortedTasks(List<PeriodicTask> unsorted) {
89
85
return tasks ;
90
86
}
91
87
92
- private Batch findBatch (long period ) {
88
+ private Batch findBatch (long period , Batch oldBatch ) {
93
89
// All events with a period less than 1000 ms
94
90
// get their own unique batch. The rationale for
95
91
// this is to avoid a scenario where a user (mistakenly) specifies
@@ -102,7 +98,7 @@ private Batch findBatch(long period) {
102
98
return batch ;
103
99
}
104
100
}
105
- Batch batch = new Batch (period );
101
+ Batch batch = oldBatch != null ? oldBatch : new Batch (period );
106
102
batches .add (batch );
107
103
return batch ;
108
104
}
You can’t perform that action at this time.
0 commit comments