src/hotspot/share/services/memTracker.cpp
changeset 59252 623722a6aeb9
parent 58927 d8aced36e872
child 59290 97d13893ec3c
--- a/src/hotspot/share/services/memTracker.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/services/memTracker.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -183,7 +183,7 @@
   // printing the final report during normal VM exit, it should not print
   // the final report again. In addition, it should be guarded from
   // recursive calls in case NMT reporting itself crashes.
-  if (Atomic::cmpxchg(true, &g_final_report_did_run, false) == false) {
+  if (Atomic::cmpxchg(&g_final_report_did_run, false, true) == false) {
     NMT_TrackingLevel level = tracking_level();
     if (level >= NMT_summary) {
       report(level == NMT_summary, output);