harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r573306 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp
Date Thu, 06 Sep 2007 15:59:51 GMT
Author: gshimansky
Date: Thu Sep  6 08:59:51 2007
New Revision: 573306

URL: http://svn.apache.org/viewvc?rev=573306&view=rev
Log:
Fixed bug when thread object is NULL for HARMONY-3971 and HARMONY-4469


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=573306&r1=573305&r2=573306&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 Thu Sep  6 08:59:51
2007
@@ -25,6 +25,7 @@
 #include <open/jthread.h>
 #include <open/thread_externals.h>
 #include "vm_threads.h"
+#include "object_handles.h"
 
 /**
  * Returns the list of all Java threads.
@@ -47,7 +48,7 @@
         hythread_t native_thread = hythread_iterator_next(&iterator);
         vm_thread_t vm_thread =
             (vm_thread_t) hythread_tls_get(native_thread, TM_THREAD_VM_TLS_KEY);
-        if (vm_thread) {
+        if (vm_thread && vm_thread->java_thread) {
             java_thread_count++;
         }
     }
@@ -64,8 +65,14 @@
         hythread_t native_thread = hythread_iterator_next(&iterator);
         vm_thread_t vm_thread =
             (vm_thread_t) hythread_tls_get(native_thread, TM_THREAD_VM_TLS_KEY);
-        if (vm_thread) {
-            java_threads[java_thread_count++] = vm_thread->java_thread;
+        if (vm_thread && vm_thread->java_thread) {
+            hythread_suspend_disable();
+            ObjectHandle thr = oh_allocate_local_handle();
+            assert(thr);
+            thr->object = vm_thread->java_thread->object;
+            assert(thr->object);
+            hythread_suspend_enable();
+            java_threads[java_thread_count++] = thr;
         }
     }
     *threads = java_threads;



Mime
View raw message