From 6ef43f5665c6e52af2074d64af0146034568fca2 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Wed, 17 Jan 2007 22:05:10 +0000 Subject: [PATCH] natThread.cc (finish_): Add JVMTI ThreadEnd notification. * java/lang/natThread.cc (finish_): Add JVMTI ThreadEnd notification. (_Jv_NotifyThreadStart): Add JVMTI ThreadStart notification. From-SVN: r120877 --- libjava/ChangeLog | 5 +++++ libjava/java/lang/natThread.cc | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 0ee504a0b6a..64ce665ef4d 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2007-01-17 Keith Seitz + + * java/lang/natThread.cc (finish_): Add JVMTI ThreadEnd notification. + (_Jv_NotifyThreadStart): Add JVMTI ThreadStart notification. + 2007-01-16 Jack Howarth * configure.ac: Use multi.m4 from aclocal rather than custom diff --git a/libjava/java/lang/natThread.cc b/libjava/java/lang/natThread.cc index 9e2f7dd674d..8a09f4f1a0f 100644 --- a/libjava/java/lang/natThread.cc +++ b/libjava/java/lang/natThread.cc @@ -27,6 +27,8 @@ details. */ #include #include +#include +#include "jvmti-int.h" #ifdef ENABLE_JVMPI #include @@ -215,6 +217,9 @@ java::lang::Thread::finish_ () nt->park_helper.deactivate (); group->removeThread (this); + if (JVMTI_REQUESTED_EVENT (ThreadEnd)) + _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, this, nt->jni_env); + #ifdef ENABLE_JVMPI if (_Jv_JVMPI_Notify_THREAD_END) { @@ -253,6 +258,12 @@ java::lang::Thread::finish_ () static void _Jv_NotifyThreadStart (java::lang::Thread* thread) { + if (JVMTI_REQUESTED_EVENT (ThreadStart)) + { + natThread *nt = reinterpret_cast (thread->data); + _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_START, thread, nt->jni_env); + } + #ifdef ENABLE_JVMPI if (_Jv_JVMPI_Notify_THREAD_START) {