harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r599381 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/jvmti_direct.h src/jvmti/jvmti.cpp src/jvmti/jvmti_capability.cpp src/jvmti/jvmti_event.cpp src/jvmti/jvmti_heap.cpp
Date Thu, 29 Nov 2007 11:13:18 GMT
Author: gshimansky
Date: Thu Nov 29 03:13:17 2007
New Revision: 599381

URL: http://svn.apache.org/viewvc?rev=599381&view=rev
Log:
Fixed HARMONY-5213
[drlvm][jvmti] ega scenario fails at SimpleGBeanDataTest.java

There were two missing unlocks on return paths in add_event_to_thread
function. Also I renamed environment lock from "lock" to
"environment_data_lock" so that it is easier to grep for in the sources.


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_direct.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_direct.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_direct.h?rev=599381&r1=599380&r2=599381&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_direct.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_direct.h Thu Nov 29 03:13:17 2007
@@ -54,7 +54,7 @@
     const ti_interface *functions;
 
     /// Lock used to protect TIEnv instance
-    hymutex_t lock;
+    hymutex_t environment_data_lock;
 
     JavaVM_Internal *vm;
     Agent *agent;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp?rev=599381&r1=599380&r2=599381&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp Thu Nov 29 03:13:17 2007
@@ -251,7 +251,8 @@
 
     memset(newenv, 0, sizeof(TIEnv));
 
-    IDATA error_code1 = hymutex_create(&newenv->lock, APR_THREAD_MUTEX_NESTED);
+    IDATA error_code1 = hymutex_create(&newenv->environment_data_lock,
+        APR_THREAD_MUTEX_NESTED);
     if (error_code1 != APR_SUCCESS)
     {
         _deallocate((unsigned char *)newenv);
@@ -262,7 +263,7 @@
     error_code = newenv->allocate_extension_event_callbacks_table();
     if (error_code != JVMTI_ERROR_NONE)
     {
-        hymutex_destroy(&newenv->lock);
+        hymutex_destroy(&newenv->environment_data_lock);
         _deallocate((unsigned char *)newenv);
         *env = NULL;
         return error_code;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp?rev=599381&r1=599380&r2=599381&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp Thu Nov 29 03:13:17
2007
@@ -446,13 +446,13 @@
     if (removed_caps.can_tag_objects) {
         // clear tags on relinquishing can_tag_objects capability
         ti_env = reinterpret_cast<TIEnv *>(env);
-        hymutex_lock(&ti_env->lock);
+        hymutex_lock(&ti_env->environment_data_lock);
         if (ti_env->tags) {
             ti_env->tags->clear();
             delete ti_env->tags;
             ti_env->tags = NULL;
         }
-        hymutex_unlock(&ti_env->lock);
+        hymutex_unlock(&ti_env->environment_data_lock);
 
         ti->reset_global_capability(DebugUtilsTI::TI_GC_ENABLE_TAG_OBJECTS);
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?rev=599381&r1=599380&r2=599381&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Thu Nov 29 03:13:17 2007
@@ -87,20 +87,26 @@
     TIEventThread *et = p_env->event_threads[event_type - JVMTI_MIN_EVENT_TYPE_VAL];
 
     // protect event_threads collection
-    hymutex_lock(&(p_env->lock));
+    hymutex_lock(&(p_env->environment_data_lock));
 
     // Find out if this environment is already registered on this thread on this event type
     while (NULL != et)
     {
         if (et->thread == p_thread)
+        {
+            hymutex_unlock(&(p_env->environment_data_lock));
             return JVMTI_ERROR_NONE;
+        }
         et = et->next;
     }
 
     TIEventThread *newet;
     jvmtiError errorCode = _allocate(sizeof(TIEventThread), (unsigned char **)&newet);
     if (JVMTI_ERROR_NONE != errorCode)
+    {
+        hymutex_unlock(&(p_env->environment_data_lock));
         return errorCode;
+    }
     newet->thread = p_thread;
 
     // record event is needed
@@ -110,7 +116,7 @@
     p_env->event_threads[event_type - JVMTI_MIN_EVENT_TYPE_VAL] = newet;
 
     // free environment lock
-    hymutex_unlock(&(p_env->lock));
+    hymutex_unlock(&(p_env->environment_data_lock));
     return JVMTI_ERROR_NONE;
 }
 
@@ -124,14 +130,14 @@
         return;
 
     // protect event_threads collection
-    hymutex_lock(&(p_env->lock));
+    hymutex_lock(&(p_env->environment_data_lock));
 
     if (et->thread == p_thread)
     {
         VM_Global_State::loader_env->TI->removeEventSubscriber(event_type);
         p_env->event_threads[event_type - JVMTI_MIN_EVENT_TYPE_VAL] = et->next;
         _deallocate((unsigned char *)et);
-        hymutex_unlock(&(p_env->lock));
+        hymutex_unlock(&(p_env->environment_data_lock));
         return;
     }
 
@@ -144,36 +150,36 @@
             TIEventThread *oldet = et->next;
             et->next = oldet->next;
             _deallocate((unsigned char *)oldet);
-            hymutex_unlock(&(p_env->lock));
+            hymutex_unlock(&(p_env->environment_data_lock));
             return;
         }
         et = et->next;
     }
 
     // release protection
-    hymutex_unlock(&(p_env->lock));
+    hymutex_unlock(&(p_env->environment_data_lock));
 }
 
 void add_event_to_global(jvmtiEnv *env, jvmtiEvent event_type)
 {
     TIEnv *p_env = (TIEnv *)env;
-    hymutex_lock(&(p_env->lock));
+    hymutex_lock(&(p_env->environment_data_lock));
     if(!p_env->global_events[event_type - JVMTI_MIN_EVENT_TYPE_VAL]) {
         VM_Global_State::loader_env->TI->addEventSubscriber(event_type);
     }
     p_env->global_events[event_type - JVMTI_MIN_EVENT_TYPE_VAL] = true;
-    hymutex_unlock(&(p_env->lock));
+    hymutex_unlock(&(p_env->environment_data_lock));
 }
 
 void remove_event_from_global(jvmtiEnv *env, jvmtiEvent event_type)
 {
     TIEnv *p_env = (TIEnv *)env;
-    hymutex_lock(&(p_env->lock));
+    hymutex_lock(&(p_env->environment_data_lock));
     if(p_env->global_events[event_type - JVMTI_MIN_EVENT_TYPE_VAL]) {
         VM_Global_State::loader_env->TI->removeEventSubscriber(event_type);
     }
     p_env->global_events[event_type - JVMTI_MIN_EVENT_TYPE_VAL] = false;
-    hymutex_unlock(&(p_env->lock));
+    hymutex_unlock(&(p_env->environment_data_lock));
 }
 
 // disable all events except VM_DEATH

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp?rev=599381&r1=599380&r2=599381&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp Thu Nov 29 03:13:17 2007
@@ -124,11 +124,11 @@
         return JVMTI_ERROR_INVALID_OBJECT;
 
     if (ti_env->tags == NULL) {
-        hymutex_lock(&ti_env->lock);
+        hymutex_lock(&ti_env->environment_data_lock);
         if (ti_env->tags == NULL) {
             ti_env->tags = new TITags;
         }
-        hymutex_unlock(&ti_env->lock);
+        hymutex_unlock(&ti_env->environment_data_lock);
     }
 
     if (ti_env->tags == NULL) {



Mime
View raw message