aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_timer.cpp
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-04 22:41:42 -0700
committerGraydon Hoare <[email protected]>2010-07-04 22:41:42 -0700
commit75f0c369317059a2a50467ab43a75c2ea4baca5f (patch)
treef26457b815fa805971ff0c90497f2e138ffb637d /src/rt/rust_timer.cpp
parentXFAIL native-mod when running MINGW_CROSS. (diff)
downloadrust-75f0c369317059a2a50467ab43a75c2ea4baca5f.tar.xz
rust-75f0c369317059a2a50467ab43a75c2ea4baca5f.zip
Perform valgrind-specific timing tweaks in a platform-sensitive manner.
Diffstat (limited to 'src/rt/rust_timer.cpp')
-rw-r--r--src/rt/rust_timer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rt/rust_timer.cpp b/src/rt/rust_timer.cpp
index 997fbb51..fdee3075 100644
--- a/src/rt/rust_timer.cpp
+++ b/src/rt/rust_timer.cpp
@@ -65,14 +65,15 @@ rust_timer::rust_timer(rust_dom &dom) : dom(dom), exit_flag(0)
#if defined(__WIN32__)
thread = CreateThread(NULL, 0, timer_loop, this, 0, NULL);
dom.win32_require("CreateThread", thread != NULL);
+ if (RUNNING_ON_VALGRIND)
+ Sleep(10);
#else
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
pthread_create(&thread, &attr, timer_loop, (void *)this);
-#endif
- if (RUNNING_ON_VALGRIND) {
+ if (RUNNING_ON_VALGRIND)
usleep(10000);
- }
+#endif
}
rust_timer::~rust_timer()