harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r540766 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp
Date Tue, 22 May 2007 21:52:04 GMT
Author: gshimansky
Date: Tue May 22 14:52:03 2007
New Revision: 540766

URL: http://svn.apache.org/viewvc?view=rev&rev=540766
Log:
Applied HARMONY-3929 [drlvm][object] Known/proven race conditions markup at vm\vmcore\src\object\object_handles.cpp(443-482)


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp?view=diff&rev=540766&r1=540765&r2=540766
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp Tue May 22 14:52:03
2007
@@ -38,6 +38,7 @@
 #include "open/types.h"
 #include "open/vm_util.h"
 #include "vtable.h"
+#include "port_threadunsafe.h"
 
 #ifndef NDEBUG
 // this is for managed object sanity checks
@@ -440,16 +441,20 @@
 {
     ObjectHandlesNew* h = (ObjectHandlesNew*)head;
 #ifdef VM_STATS
+    UNSAFE_REGION_START
     VM_Statistics::get_vm_stats().num_free_local_called++;
     if(h != NULL)
         VM_Statistics::get_vm_stats().num_free_local_called_free++;
+        UNSAFE_REGION_END
 #endif //VM_STATS
     while(h) {
 #ifdef VM_STATS
         unsigned size = h->size;
+        UNSAFE_REGION_START
         VM_Statistics::get_vm_stats().num_local_jni_handles += size;
         VM_Statistics::get_vm_stats().num_jni_handles_freed++;
         VM_Statistics::get_vm_stats().num_jni_handles_wasted_refs += (h->capacity - size);
+        UNSAFE_REGION_END
 #endif //VM_STATS
         ObjectHandlesNew* next = h->next;
         STD_FREE(h);
@@ -463,23 +468,29 @@
     ObjectHandlesNew* h = (ObjectHandlesNew*)head;
     assert(h);
 #ifdef VM_STATS
+    UNSAFE_REGION_START
     VM_Statistics::get_vm_stats().num_free_local_called++;
     if(h->next != NULL)
         VM_Statistics::get_vm_stats().num_free_local_called_free++;
+        UNSAFE_REGION_END
 #endif //VM_STATS
     while(h->next) {
 #ifdef VM_STATS
         unsigned size = h->size;
+        UNSAFE_REGION_START
         VM_Statistics::get_vm_stats().num_local_jni_handles += size;
         VM_Statistics::get_vm_stats().num_jni_handles_freed++;
         VM_Statistics::get_vm_stats().num_jni_handles_wasted_refs += (h->capacity - size);
+        UNSAFE_REGION_END
 #endif //VM_STATS
         ObjectHandlesNew* next = h->next;
         STD_FREE(h);
         h = next;
     }
 #ifdef VM_STATS
+    UNSAFE_REGION_START
     VM_Statistics::get_vm_stats().num_jni_handles_wasted_refs += (h->capacity - h->size);
+    UNSAFE_REGION_END
 #endif //VM_STATS
 }
 



Mime
View raw message