< prev index next >

src/hotspot/share/memory/heapInspection.cpp

Print this page

        

@@ -33,10 +33,11 @@
 #include "memory/heapInspection.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/reflectionAccessorImplKlassHelper.hpp"
+#include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/stack.inline.hpp"
 

@@ -548,11 +549,11 @@
 // worker set _success to false, but this is OK because the current worker
 // doesn't change _success if everything is OK for it's inpection work, and
 // the _success will be false finally and serial heap inpection can be tried.
 void ParHeapInspectTask::work(uint worker_id) {
   size_t missed_count = 0;
-  if (!_success) {
+  if (!Atomic::load(&_success)) {
     // other worker has failed on parallel iteration.
     return;
   }
 
   KlassInfoTable cit(false);

@@ -561,18 +562,18 @@
     _poi->object_iterate(&ric, worker_id);
     // _heap->object_iterate_parallel(&ric, worker_id, _par_thread_num);
     missed_count = ric.missed_count();
   } else {
     // fail to allocate memory, stop parallel mode
-    _success = false;
+    Atomic::store(&_success, false);
     return;
   }
   {
     MutexLocker x(&_mutex);
 
     if (!_shared_cit->merge(&cit)) {
-      _success = false;
+      Atomic::store(&_success, false);
       return;
     }
     _shared_missed_count += missed_count;
   }
 }
< prev index next >