harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r475944 - in /incubator/harmony/enhanced/drlvm/trunk/vm: tests/unit/thread/test_native_fat_monitor.c thread/src/thread_init.c thread/src/thread_native_fat_monitor.c thread/src/thread_native_thin_monitor.c thread/src/thread_ti_monitors.c
Date Thu, 16 Nov 2006 22:06:31 GMT
Author: gshimansky
Date: Thu Nov 16 14:06:30 2006
New Revision: 475944

URL: http://svn.apache.org/viewvc?view=rev&rev=475944
Log:
Applied HARMONY-2149 [drlvm][threading] hythread_monitor_init() should not acqure a monitor

Tests passed on winxp, ubuntu, FC5 and SuSE10 x86_64 (with some exceptions on x86_64)


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_native_fat_monitor.c
    incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c
    incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_fat_monitor.c
    incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c
    incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_ti_monitors.c

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_native_fat_monitor.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_native_fat_monitor.c?view=diff&rev=475944&r1=475943&r2=475944
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_native_fat_monitor.c
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_native_fat_monitor.c
Thu Nov 16 14:06:30 2006
@@ -56,7 +56,6 @@
     //log_error("BUG IN APR");
     //tf_assert(0);
     status = hythread_monitor_init(&monitor, 0);
-   status = hythread_monitor_exit(monitor);
     tf_assert_same(status, TM_ERROR_NONE);
     waiting_count = 0;
 

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c?view=diff&rev=475944&r1=475943&r2=475944
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c Thu Nov 16 14:06:30
2006
@@ -188,10 +188,8 @@
         mon = (hythread_monitor_t*)hythread_global(GLOBAL_MONITOR_NAME);
     *mon = p_global_monitor;
     assert(mon);
-    status=hythread_monitor_exit(p_global_monitor);
-    assert (status == TM_ERROR_NONE);
-
 }
+
 /**
  * Shut down the threading library associated with the current thread.
  * 

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_fat_monitor.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_fat_monitor.c?view=diff&rev=475944&r1=475943&r2=475944
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_fat_monitor.c (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_fat_monitor.c Thu Nov
16 14:06:30 2006
@@ -51,7 +51,6 @@
     hythread_monitor_t mon;
     apr_pool_t *pool = get_local_pool(); 
     apr_status_t apr_status;
-        IDATA status;
         
         mon = apr_pcalloc(pool, sizeof(HyThreadMonitor));
         if(mon == NULL) {
@@ -68,9 +67,6 @@
     mon->flags = flags;
     mon->name  = name;
     mon->owner = 0;
-
-    status=hythread_monitor_enter(mon);
-        if (status != TM_ERROR_NONE) return status;
 
         *mon_ptr = mon;
     return TM_ERROR_NONE;

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c?view=diff&rev=475944&r1=475943&r2=475944
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c Thu
Nov 16 14:06:30 2006
@@ -574,17 +574,14 @@
     assert (!hythread_is_suspend_enabled());
 
     TRACE (("inflation begin for %x thread: %d", lockword, tm_self_tls->thread_id));
-    status = hythread_monitor_init(&fat_monitor, 0); // allocate fat fat_monitor
+    status = hythread_monitor_init(&fat_monitor, 0); // allocate fat fat_monitor    
     assert(status == TM_ERROR_NONE);  
+    status = hythread_monitor_enter(fat_monitor);
     if(status != TM_ERROR_NONE) {
         hymutex_unlock(FAT_MONITOR_TABLE_LOCK);
         return NULL;
     } 
     
-    /* removed due to lock acquisition in monitor creation
-     * status = hythread_monitor_enter(fat_monitor); // lock fat fat_monitor   
-     * assert(status == TM_ERROR_NONE);
-     */    
     for (i = RECURSION(lockword); i > 0; i--) {
         TRACE( ("infalte recursion monitor"));
         status = hythread_monitor_enter(fat_monitor);  // transfer recusrion count to fat
fat_monitor   

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_ti_monitors.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_ti_monitors.c?view=diff&rev=475944&r1=475943&r2=475944
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_ti_monitors.c (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_ti_monitors.c Thu Nov 16 14:06:30
2006
@@ -47,9 +47,6 @@
     IDATA status;
         status = hythread_monitor_init(&monitor, 0);
     if (status != TM_ERROR_NONE) return status;
-    //hythread monitor init also locks it
-    status = hythread_monitor_exit(monitor);
-    if (status != TM_ERROR_NONE) return status;
     // possibly should be moved to jvmti(environment?) init section
     //// 
     if (!jvmti_monitor_table) {



Mime
View raw message