about summary refs log tree commit diff
path: root/src/rt/rust_timer.cpp
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-07-22 15:05:35 -0700
committerGraydon Hoare <graydon@mozilla.com>2010-07-22 15:05:35 -0700
commit0f220ecae921f961f0c40395218de86cc2b33849 (patch)
treee575036b7ab1d6b0031268aa854f52f55261d7c4 /src/rt/rust_timer.cpp
parent37088659061fad1f53513ec7088802ef6dd7af57 (diff)
downloadrust-0f220ecae921f961f0c40395218de86cc2b33849.tar.gz
rust-0f220ecae921f961f0c40395218de86cc2b33849.zip
Beat up on the preempt test a bit more, as it keeps hanging under valgrind.
Diffstat (limited to 'src/rt/rust_timer.cpp')
-rw-r--r--src/rt/rust_timer.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rt/rust_timer.cpp b/src/rt/rust_timer.cpp
index bf4d18e836d..9427ec673ff 100644
--- a/src/rt/rust_timer.cpp
+++ b/src/rt/rust_timer.cpp
@@ -32,10 +32,9 @@ timer_loop(void *ptr) {
     rust_dom *dom = timer->dom;
     dom->log(rust_log::TIMER, "in timer 0x%" PRIxPTR, (uintptr_t)timer);
     size_t ms = TIME_SLICE_IN_MS;
-    if (!RUNNING_ON_VALGRIND)
-        ms = 1;
 
     while (!timer->exit_flag) {
+        YIELD_C_THREAD_IF_ON_VALGRIND;
 #if defined(__WIN32__)
         Sleep(ms);
 #else
@@ -66,8 +65,6 @@ rust_timer::rust_timer(rust_dom *dom) :
     pthread_attr_init(&attr);
     pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
     pthread_create(&thread, &attr, timer_loop, (void *)this);
-    if (RUNNING_ON_VALGRIND)
-        usleep(10000);
 #endif
 }