harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r548408 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: jvmti/jvmti_stack.cpp kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
Date Mon, 18 Jun 2007 16:38:47 GMT
Author: gshimansky
Date: Mon Jun 18 09:38:45 2007
New Revision: 548408

URL: http://svn.apache.org/viewvc?view=rev&rev=548408
Log:
Applied HARMONY-3542
[drlvm][thread] VM crashes on getting stack traces


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp?view=diff&rev=548408&r1=548407&r2=548408
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp Mon Jun 18 09:38:45 2007
@@ -300,8 +300,16 @@
         // Check that this thread is not current
         if (vm_thread != p_TLS_vmthread)
         {
+            // to avoid suspension of each other due to race condition
+            // get global thread lock as it's done in hythread_suspend_all().
+            IDATA UNREF status = hythread_global_lock();
+            assert(0 == status);
+
             jthread_suspend(thread);
             thread_suspended = true;
+
+            status = hythread_global_unlock();
+            assert(0 == status);
         }
     }
     else

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp?view=diff&rev=548408&r1=548407&r2=548408
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
Mon Jun 18 09:38:45 2007
@@ -449,9 +449,17 @@
         if (p_thread == get_thread_ptr()) {
             st_get_trace(p_thread, &size, &frames);
         } else {
+            // to avoid suspension of each other due to race condition
+            // get global thread lock as it's done in hythread_suspend_all().
+            IDATA UNREF status = hythread_global_lock();
+            assert(0 == status);
+
             jthread_suspend(thread);
             st_get_trace(p_thread, &size, &frames);
             jthread_resume(thread);
+
+            status = hythread_global_unlock();
+            assert(0 == status);
         }
     }
 



Mime
View raw message