aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_internal.h
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-22 15:05:35 -0700
committerGraydon Hoare <[email protected]>2010-07-22 15:05:35 -0700
commit0f220ecae921f961f0c40395218de86cc2b33849 (patch)
treee575036b7ab1d6b0031268aa854f52f55261d7c4 /src/rt/rust_internal.h
parentRe-introduce bits of vec-lib test that blocked on now-fixed issue #108. (diff)
downloadrust-0f220ecae921f961f0c40395218de86cc2b33849.tar.xz
rust-0f220ecae921f961f0c40395218de86cc2b33849.zip
Beat up on the preempt test a bit more, as it keeps hanging under valgrind.
Diffstat (limited to 'src/rt/rust_internal.h')
-rw-r--r--src/rt/rust_internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h
index d962e894..99f52165 100644
--- a/src/rt/rust_internal.h
+++ b/src/rt/rust_internal.h
@@ -67,6 +67,17 @@ struct frame_glue_fns;
static size_t const TIME_SLICE_IN_MS = 10;
+// This helps our preemption scheme handle "running on valgrind".
+
+#if defined(__WIN32__)
+#define YIELD_C_THREAD_IF_ON_VALGRIND (void);
+#else
+#define YIELD_C_THREAD_IF_ON_VALGRIND \
+ if (RUNNING_ON_VALGRIND) { \
+ pthread_yield(); \
+ }
+#endif
+
// Every reference counted object should derive from this base class.
template <typename T>