File tree 1 file changed +7
-1
lines changed
test/hotspot/gtest/gc/shared
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -180,12 +180,18 @@ class BufferNode::TestSupport::ProcessorThread : public JavaTestThread {
180
180
{}
181
181
182
182
virtual void main_run () {
183
+ bool shutdown_requested = false ;
183
184
while (true ) {
184
185
BufferNode* node = _cbl->pop ();
185
186
if (node != NULL ) {
186
187
_allocator->release (node);
187
- } else if (! Atomic::load_acquire (_continue_running) ) {
188
+ } else if (shutdown_requested ) {
188
189
return ;
190
+ } else if (!Atomic::load_acquire (_continue_running)) {
191
+ // To avoid a race that could leave buffers in the list after this
192
+ // thread has shut down, continue processing until the list is empty
193
+ // *after* the shut down request has been received.
194
+ shutdown_requested = true ;
189
195
}
190
196
ThreadBlockInVM tbiv (this ); // Safepoint check.
191
197
}
You can’t perform that action at this time.
0 commit comments