1992 |
1992 |
1993 if (JvmtiEnv::environments_might_exist()) { |
1993 if (JvmtiEnv::environments_might_exist()) { |
1994 JvmtiExport::cleanup_thread(this); |
1994 JvmtiExport::cleanup_thread(this); |
1995 } |
1995 } |
1996 |
1996 |
1997 // We must flush any deferred card marks before removing a thread from |
1997 // We must flush any deferred card marks and other various GC barrier |
1998 // the list of active threads. |
1998 // related buffers (e.g. G1 SATB buffer and G1 dirty card queue buffer) |
1999 Universe::heap()->flush_deferred_store_barrier(this); |
1999 // before removing a thread from the list of active threads. |
2000 assert(deferred_card_mark().is_empty(), "Should have been flushed"); |
2000 BarrierSet::barrier_set()->flush_deferred_barriers(this); |
2001 |
|
2002 #if INCLUDE_ALL_GCS |
|
2003 // We must flush the G1-related buffers before removing a thread |
|
2004 // from the list of active threads. We must do this after any deferred |
|
2005 // card marks have been flushed (above) so that any entries that are |
|
2006 // added to the thread's dirty card queue as a result are not lost. |
|
2007 if (UseG1GC) { |
|
2008 flush_barrier_queues(); |
|
2009 } |
|
2010 #endif // INCLUDE_ALL_GCS |
|
2011 |
2001 |
2012 log_info(os, thread)("JavaThread %s (tid: " UINTX_FORMAT ").", |
2002 log_info(os, thread)("JavaThread %s (tid: " UINTX_FORMAT ").", |
2013 exit_type == JavaThread::normal_exit ? "exiting" : "detaching", |
2003 exit_type == JavaThread::normal_exit ? "exiting" : "detaching", |
2014 os::current_thread_id()); |
2004 os::current_thread_id()); |
2015 |
2005 |