--- a/src/hotspot/share/prims/jni.cpp Wed Nov 22 14:31:48 2017 -0500
+++ b/src/hotspot/share/prims/jni.cpp Wed Nov 22 17:54:50 2017 -0800
@@ -4119,7 +4119,7 @@
thread->initialize_thread_current();
if (!os::create_attached_thread(thread)) {
- delete thread;
+ thread->smr_delete();
return JNI_ERR;
}
// Enable stack overflow checks
@@ -4250,7 +4250,7 @@
// (platform-dependent) methods where we do alternate stack
// maintenance work?)
thread->exit(false, JavaThread::jni_detach);
- delete thread;
+ thread->smr_delete();
HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(JNI_OK);
return JNI_OK;