harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r574926 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread: thread_ti_instr.cpp thread_ti_timing.cpp
Date Wed, 12 Sep 2007 12:51:17 GMT
Author: gshimansky
Date: Wed Sep 12 05:51:17 2007
New Revision: 574926

URL: http://svn.apache.org/viewvc?rev=574926&view=rev
Log:
Changed some assertions to work ok with dead threads. This fixes problem with lang.management
in HARMONY-3967


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_timing.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp?rev=574926&r1=574925&r2=574926&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp Wed Sep 12 05:51:17
2007
@@ -365,8 +365,10 @@
     assert(java_thread);
     hythread_t native_thread = vm_jthread_get_tm_data(java_thread);
     jvmti_thread_t jvmti_thread = jthread_get_jvmti_thread(native_thread);
-    assert(jvmti_thread);
-    *monitor = jvmti_thread->contended_monitor;
+    if (jvmti_thread)
+        *monitor = jvmti_thread->contended_monitor;
+	else
+		*monitor = NULL;
     return TM_ERROR_NONE;
 } // jthread_get_contended_monitor
 
@@ -382,8 +384,10 @@
     assert(java_thread);
     hythread_t native_thread = vm_jthread_get_tm_data(java_thread);
     jvmti_thread_t jvmti_thread = jthread_get_jvmti_thread(native_thread);
-    assert(jvmti_thread);
-    *monitor = jvmti_thread->wait_monitor;
+    if (jvmti_thread)
+        *monitor = jvmti_thread->wait_monitor;
+	else
+		*monitor = NULL;
     return TM_ERROR_NONE;
 } // jthread_get_wait_monitor
 
@@ -467,7 +471,11 @@
     }
     hythread_t native_thread = vm_jthread_get_tm_data(java_thread);
     jvmti_thread_t jvmti_thread = jthread_get_jvmti_thread(native_thread);
-    assert(jvmti_thread);
+    if (!jvmti_thread)
+	{
+        status = hythread_global_unlock();
+        return status;
+	}
 
     jobject *monitors =
         (jobject *) malloc(sizeof(jobject *) *

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_timing.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_timing.cpp?rev=574926&r1=574925&r2=574926&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_timing.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_timing.cpp Wed Sep 12 05:51:17
2007
@@ -48,8 +48,10 @@
     hythread_t native_thread = vm_jthread_get_tm_data(java_thread);
     assert(native_thread);
     jvmti_thread_t jvmti_thread = jthread_get_jvmti_thread(native_thread);
-    assert(jvmti_thread);
-    *nanos_ptr = jvmti_thread->blocked_time;
+    if (jvmti_thread)
+        *nanos_ptr = jvmti_thread->blocked_time;
+	else
+		*nanos_ptr = 0;
     return TM_ERROR_NONE;
 } // jthread_get_thread_blocked_time
 
@@ -119,8 +121,10 @@
     hythread_t native_thread = vm_jthread_get_tm_data(java_thread);
     assert(native_thread);
     jvmti_thread_t jvmti_thread = jthread_get_jvmti_thread(native_thread);
-    assert(jvmti_thread);
-    *nanos_ptr = jvmti_thread->waited_time;
+    if (jvmti_thread)
+        *nanos_ptr = jvmti_thread->waited_time;
+	else
+		*nanos_ptr = 0;
 
     return TM_ERROR_NONE;
 } // jthread_get_thread_waited_time
@@ -137,8 +141,10 @@
     hythread_t native_thread = jthread_get_native_thread(java_thread);
     assert(native_thread);
     jvmti_thread_t jvmti_thread = jthread_get_jvmti_thread(native_thread);
-    assert(jvmti_thread);
-    return jvmti_thread->blocked_count;
+    if (jvmti_thread)
+        return jvmti_thread->blocked_count;
+	else
+		return 0;
 } // jthread_get_thread_blocked_times_count
 
 /**
@@ -153,8 +159,10 @@
     hythread_t native_thread = jthread_get_native_thread(java_thread);
     assert(native_thread);
     jvmti_thread_t jvmti_thread = jthread_get_jvmti_thread(native_thread);
-    assert(jvmti_thread);
-    return jvmti_thread->waited_count;
+    if (jvmti_thread)
+        return jvmti_thread->waited_count;
+	else
+		return 0;
 } // jthread_get_thread_waited_times_count
 
 /**



Mime
View raw message