harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcfi...@apache.org
Subject svn commit: r634713 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp
Date Fri, 07 Mar 2008 15:19:37 GMT
Author: mcfirst
Date: Fri Mar  7 07:19:35 2008
New Revision: 634713

URL: http://svn.apache.org/viewvc?rev=634713&view=rev
Log:
Applying patch from HARMONY-5533 [drlvm] SystemResourceOrientedTest failure from the reliability
test suite

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.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=634713&r1=634712&r2=634713&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 Fri Mar  7 07:19:35
2008
@@ -364,13 +364,16 @@
 jthread_get_contended_monitor(jthread java_thread, jobject * monitor)
 {
     assert(java_thread);
+    assert(monitor);
+    *monitor = NULL;
     vm_thread_t vm_thread = jthread_get_vm_thread_from_java(java_thread);
-    assert(vm_thread);
+    if (!vm_thread) {
+        return TM_ERROR_NONE;
+    }
     jvmti_thread_t jvmti_thread = &vm_thread->jvmti_thread;
-    if (jvmti_thread)
+    if (jvmti_thread) {
         *monitor = jvmti_thread->contended_monitor;
-	else
-		*monitor = NULL;
+    }
     return TM_ERROR_NONE;
 } // jthread_get_contended_monitor
 
@@ -384,13 +387,16 @@
 IDATA VMCALL jthread_get_wait_monitor(jthread java_thread, jobject * monitor)
 {
     assert(java_thread);
+    assert(monitor);
+    *monitor = NULL;
     vm_thread_t vm_thread = jthread_get_vm_thread_from_java(java_thread);
-    assert(vm_thread);
+    if (!vm_thread) {
+        return TM_ERROR_NONE;
+    }
     jvmti_thread_t jvmti_thread = &vm_thread->jvmti_thread;
-    if (jvmti_thread)
+    if (jvmti_thread) {
         *monitor = jvmti_thread->wait_monitor;
-	else
-		*monitor = NULL;
+    }
     return TM_ERROR_NONE;
 } // jthread_get_wait_monitor
 
@@ -407,19 +413,23 @@
     assert(monitor);
     assert(lock_owner);
 
+    *lock_owner = NULL;
+    IDATA status = TM_ERROR_NONE;
+
     hythread_suspend_disable();
     hythread_thin_monitor_t *lockword = vm_object_get_lockword_addr(monitor);
     hythread_t native_thread = hythread_thin_monitor_get_owner(lockword);
-    if (!native_thread) {
-        *lock_owner = NULL;
-    } else {
+    if (native_thread) {
         vm_thread_t vm_thread = jthread_get_vm_thread(native_thread);
-        assert(vm_thread);
-        *lock_owner = vm_thread->java_thread;
+        if (vm_thread) {
+            *lock_owner = vm_thread->java_thread;
+        } else {
+            status = TM_ERROR_ILLEGAL_STATE;
+        }
     }
     hythread_suspend_enable();
 
-    return TM_ERROR_NONE;
+    return status;
 } // jthread_get_lock_owner
 
 /**
@@ -472,9 +482,11 @@
     if (status != TM_ERROR_NONE) {
         return status;
     }
-    assert(java_thread);
     vm_thread_t vm_thread = jthread_get_vm_thread_from_java(java_thread);
-    assert(vm_thread);
+    if (!vm_thread) {
+        status = hythread_global_unlock();
+        return status;
+    }
     jvmti_thread_t jvmti_thread = &vm_thread->jvmti_thread;
     if (!jvmti_thread)
 	{



Mime
View raw message