harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r510503 - in /harmony/enhanced/drlvm/trunk/vm/tests/unit/thread: test_ti_instrum.c utils/thread_unit_test_utils.h
Date Thu, 22 Feb 2007 13:36:24 GMT
Author: varlax
Date: Thu Feb 22 05:36:23 2007
New Revision: 510503

URL: http://svn.apache.org/viewvc?view=rev&rev=510503
Log:
Applied HARMONY-3018 [drlvm][unit] cunit test thread/test_ti_instrum.c fails from time to
time

Modified:
    harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_ti_instrum.c
    harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h

Modified: harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_ti_instrum.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_ti_instrum.c?view=diff&rev=510503&r1=510502&r2=510503
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_ti_instrum.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_ti_instrum.c Thu Feb 22 05:36:23
2007
@@ -132,10 +132,12 @@
                 critical_tts = tts;
             }
         }
-        // TODO: unsafe .... need to find another way of synchronization
-        hythread_sleep(1000);
-        tf_assert_same(jthread_get_blocked_count(&waiting_on_monitor_nmb), TM_ERROR_NONE);
-        if (MAX_TESTED_THREAD_NUMBER - i != waiting_on_monitor_nmb + 1){
+        int cycles = MAX_TIME_TO_WAIT / CLICK_TIME_MSEC;
+        while ((MAX_TESTED_THREAD_NUMBER - i > waiting_on_monitor_nmb + 1) &&
(cycles-- > 0)) {
+            tf_assert_same(jthread_get_blocked_count(&waiting_on_monitor_nmb), TM_ERROR_NONE);
+            sleep_a_click();
+        }
+        if (cycles < 0){
             tf_fail("Wrong number waiting on monitor threads");
         }
         tested_thread_send_stop_request(critical_tts);

Modified: harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h?view=diff&rev=510503&r1=510502&r2=510503
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/utils/thread_unit_test_utils.h Thu Feb
22 05:36:23 2007
@@ -44,7 +44,7 @@
 #define TTS_INIT_DIFFERENT_MONITORS 1
 
 #define MAX_TESTED_THREAD_NUMBER 5
-#define MAX_TIME_TO_WAIT 1000
+#define MAX_TIME_TO_WAIT 600000
 #define MAX_OWNED_MONITORS_NMB 2
 #define SLEEP_TIME 100
 #define CLICK_TIME_MSEC 10



Mime
View raw message