harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcfi...@apache.org
Subject svn commit: r634710 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src: class_support/C_Interface.cpp thread/thread_generic.cpp
Date Fri, 07 Mar 2008 15:17:14 GMT
Author: mcfirst
Date: Fri Mar  7 07:17:14 2008
New Revision: 634710

URL: http://svn.apache.org/viewvc?rev=634710&view=rev
Log:
Applying patch from HARMONY-5447 [drlvm] Hang in ThreadSuspendResume test from the reliability
test suite

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_generic.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp?rev=634710&r1=634709&r2=634710&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp Fri Mar  7 07:17:14
2008
@@ -2403,10 +2403,25 @@
 
 void vm_gc_lock_enum()
 {
-    int disable_count = hythread_reset_suspend_disable();
-    IDATA UNUSED status = hymutex_lock(&vm_gc_lock);
-    assert(status == TM_ERROR_NONE);
-    hythread_set_suspend_disable(disable_count);
+    hythread_t self = tm_self_tls;
+    int disable_count = self->disable_count;
+    self->disable_count = 0;
+
+    while (true) {
+        IDATA UNUSED status = hymutex_lock(&vm_gc_lock);
+        assert(status == TM_ERROR_NONE);
+
+        self->disable_count = disable_count;
+        if (disable_count && self->suspend_count) {
+            status = hymutex_unlock(&vm_gc_lock);
+            assert(status == TM_ERROR_NONE);
+
+            self->disable_count = 0;
+            hythread_safe_point_other(self);
+        } else {
+            break;
+        }
+    }
 } // vm_gc_lock_enum
 
 void vm_gc_unlock_enum()

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_generic.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_generic.cpp?rev=634710&r1=634709&r2=634710&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_generic.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_generic.cpp Fri Mar  7 07:17:14
2008
@@ -255,8 +255,6 @@
         jvmti_send_thread_start_end_event(p_vm_thread, 0);
     }
 
-    hythread_suspend_disable();
-
     // change java_status for native thread
     native_thread->java_status = TM_STATUS_ALLOCATED;
 
@@ -282,8 +280,6 @@
 
     // Destroy current VM_thread pool and zero VM_thread structure
     jthread_deallocate_vm_thread_pool(p_vm_thread);
-
-    hythread_suspend_enable();
 
     return JNI_OK;
 }



Mime
View raw message