harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r480927 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support: Initialize.cpp Verifier_stub.cpp
Date Thu, 30 Nov 2006 13:55:13 GMT
Author: gshimansky
Date: Thu Nov 30 05:55:12 2006
New Revision: 480927

URL: http://svn.apache.org/viewvc?view=rev&rev=480927
Log:
Applied HARMONY-2248 [drlvm] failed assert(m_initializing_thread == 0) on eclipse startup

Tests passed on ubuntu, suse9 and win2003 server


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Initialize.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Verifier_stub.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Initialize.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Initialize.cpp?view=diff&rev=480927&r1=480926&r2=480927
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Initialize.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Initialize.cpp Thu Nov 30 05:55:12
2006
@@ -88,8 +88,10 @@
     TRACE2("class.init", "initializing class " << m_name->bytes << "STEP 6"
);
 
     assert(m_state == ST_ConstraintsVerified);
-    m_state = ST_Initializing;
     assert(m_initializing_thread == 0);
+    lock();
+    m_state = ST_Initializing;
+    unlock();
     m_initializing_thread = p_TLS_vmthread;
     jthread_monitor_exit(jlc);
 
@@ -105,7 +107,9 @@
                 get_super_class()->get_error_cause());
             tmn_suspend_disable();
             m_initializing_thread = NULL;
+            lock();
             m_state = ST_Error;
+            unlock();
             assert(!hythread_is_suspend_enabled());
             jthread_monitor_notify_all(jlc);
             jthread_monitor_exit(jlc);
@@ -118,7 +122,9 @@
     Method* meth = m_static_initializer;
     if(meth == NULL) {
         jthread_monitor_enter(jlc);
+        lock();
         m_state = ST_Initialized;
+        unlock();
         TRACE2("classloader", "class " << m_name->bytes << " initialized");
         m_initializing_thread = NULL;
         assert(!hythread_is_suspend_enabled());
@@ -139,7 +145,9 @@
 
     if(!p_error_object) {
         jthread_monitor_enter(jlc);
+        lock();
         m_state = ST_Initialized;
+        unlock();
         TRACE2("classloader", "class " << m_name->bytes << " initialized");
         m_initializing_thread = NULL;
         assert(m_error == NULL);
@@ -178,7 +186,9 @@
         // ---  step 11  ----------------------------------------------------------
         assert(!hythread_is_suspend_enabled());
         jthread_monitor_enter(jlc);
+        lock();
         m_state = ST_Error;
+        unlock();
         m_initializing_thread = NULL;
         assert(!hythread_is_suspend_enabled());
         jthread_monitor_notify_all(jlc);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Verifier_stub.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Verifier_stub.cpp?view=diff&rev=480927&r1=480926&r2=480927
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Verifier_stub.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Verifier_stub.cpp Thu Nov 30
05:55:12 2006
@@ -111,9 +111,14 @@
 
     // lock class and check result
     lock();
-    if(in_error()) {
+    switch(m_state)
+    {
+    case ST_ConstraintsVerified:
+    case ST_Initializing:
+    case ST_Initialized:
+    case ST_Error:
         unlock();
-        return false;
+        return true;
     }
     if( result != VER_OK ) {
         unlock();



Mime
View raw message