1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
25 Start a new thread outside of the current runtime context and wait
28 The executing thread has no access to a task pointer and will be using
31 pub fn run_in_bare_thread(f: proc:Send()) {
32 use rt::thread::Thread;
33 Thread::start(f).join()
37 fn test_run_in_bare_thread() {
39 run_in_bare_thread(proc() {
45 fn test_run_in_bare_thread_exchange() {
46 // Does the exchange heap work without the runtime?
48 run_in_bare_thread(proc() {
53 /// Dynamically inquire about whether we're running under V.
54 /// You should usually not use this unless your test definitely
55 /// can't run correctly un-altered. Valgrind is there to help
56 /// you notice weirdness in normal, un-doctored code paths!
57 pub fn running_on_valgrind() -> bool {
58 unsafe { rust_running_on_valgrind() != 0 }
62 fn rust_running_on_valgrind() -> uintptr_t;