changeset 4506:f33d68f8b40e

Merge
author johnc
date Thu, 28 Feb 2013 21:11:04 -0800
parents ee712d4e3af6 a4debcca0fb9
children 94227c0c6cf0 69ff881ab627
files
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.cpp	Fri Mar 01 03:54:26 2013 +0100
+++ b/src/share/vm/runtime/thread.cpp	Thu Feb 28 21:11:04 2013 -0800
@@ -1482,7 +1482,7 @@
   } else {
     _jni_attach_state = _not_attaching_via_jni;
   }
-  assert(_deferred_card_mark.is_empty(), "Default MemRegion ctor");
+  assert(deferred_card_mark().is_empty(), "Default MemRegion ctor");
   _safepoint_visible = false;
 }
 
@@ -1883,9 +1883,16 @@
     JvmtiExport::cleanup_thread(this);
   }
 
+  // We must flush any deferred card marks before removing a thread from
+  // the list of active threads.
+  Universe::heap()->flush_deferred_store_barrier(this);
+  assert(deferred_card_mark().is_empty(), "Should have been flushed");
+
 #ifndef SERIALGC
-  // We must flush G1-related buffers before removing a thread from
-  // the list of active threads.
+  // We must flush the G1-related buffers before removing a thread
+  // from the list of active threads. We must do this after any deferred
+  // card marks have been flushed (above) so that any entries that are
+  // added to the thread's dirty card queue as a result are not lost.
   if (UseG1GC) {
     flush_barrier_queues();
   }