1.1 --- a/src/share/vm/prims/jvmtiExport.cpp Tue Mar 15 17:39:56 2016 -0700 1.2 +++ b/src/share/vm/prims/jvmtiExport.cpp Thu Mar 17 17:09:10 2016 +0300 1.3 @@ -995,7 +995,9 @@ 1.4 // Before we call the JVMTI agent, we have to set the state in the 1.5 // thread for which we are proxying. 1.6 JavaThreadState prev_state = real_thread->thread_state(); 1.7 - assert(prev_state == _thread_blocked, "JavaThread should be at safepoint"); 1.8 + assert(((Thread *)real_thread)->is_ConcurrentGC_thread() || 1.9 + (real_thread->is_Java_thread() && prev_state == _thread_blocked), 1.10 + "should be ConcurrentGCThread or JavaThread at safepoint"); 1.11 real_thread->set_thread_state(_thread_in_native); 1.12 1.13 jvmtiExtensionEvent callback = env->ext_callbacks()->ClassUnload;