File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,13 @@ public final void run() {
103
103
}
104
104
long delay = System .currentTimeMillis () - start .get ();
105
105
System .out .println ("Accessor #" + id + " terminated - delay (ms): " + delay );
106
+ cleanup ();
106
107
}
107
108
108
109
abstract void doAccess ();
109
110
111
+ void cleanup () {}
112
+
110
113
private void backoff () {
111
114
try {
112
115
Thread .sleep (ThreadLocalRandom .current ().nextInt (MAX_THREAD_SPIN_WAIT_MILLIS ));
@@ -185,6 +188,11 @@ static class SegmentMismatchAccessor extends AbstractSegmentAccessor {
185
188
public void doAccess () {
186
189
segment .mismatch (copy );
187
190
}
191
+
192
+ @ Override
193
+ void cleanup () {
194
+ copy .close ();
195
+ }
188
196
}
189
197
190
198
static class BufferAccessor extends AbstractBufferAccessor {
@@ -251,7 +259,7 @@ static Object[][] accessors() {
251
259
return new Object [][] {
252
260
{ "SegmentAccessor" , (AccessorFactory )SegmentAccessor ::new },
253
261
{ "SegmentCopyAccessor" , (AccessorFactory )SegmentCopyAccessor ::new },
254
- { "SegmentMismatchAccesor " , (AccessorFactory )SegmentMismatchAccessor ::new },
262
+ { "SegmentMismatchAccessor " , (AccessorFactory )SegmentMismatchAccessor ::new },
255
263
{ "SegmentFillAccessor" , (AccessorFactory )SegmentFillAccessor ::new },
256
264
{ "BufferAccessor" , (AccessorFactory )BufferAccessor ::new },
257
265
{ "BufferHandleAccessor" , (AccessorFactory )BufferHandleAccessor ::new }
You can’t perform that action at this time.
1 commit comments
openjdk-notifier[bot] commentedon Nov 18, 2020
Review
Issues