src/hotspot/share/gc/shared/cardTableBarrierSet.cpp
changeset 54006 a421bdf22394
parent 50180 ffa644980dff
child 54110 f4f0dce5d0bb
--- a/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp	Tue Mar 05 14:07:30 2019 -0800
+++ b/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp	Tue Mar 05 19:54:33 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -194,11 +194,13 @@
 #endif
 }
 
-void CardTableBarrierSet::on_thread_detach(JavaThread* thread) {
+void CardTableBarrierSet::on_thread_detach(Thread* thread) {
   // The deferred store barriers must all have been flushed to the
   // card-table (or other remembered set structure) before GC starts
   // processing the card-table (or other remembered set).
-  flush_deferred_card_mark_barrier(thread);
+  if (thread->is_Java_thread()) { // Only relevant for Java threads.
+    flush_deferred_card_mark_barrier((JavaThread*)thread);
+  }
 }
 
 bool CardTableBarrierSet::card_mark_must_follow_store() const {