1 // Copyright 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.
14 #[allow(non_camel_case_types)] // runtime type
15 type raw_thread = libc::c_void;
19 raw_thread: *raw_thread
23 pub fn start(main: ~fn()) -> Thread {
24 fn substart(main: &~fn()) -> *raw_thread {
25 unsafe { rust_raw_thread_start(main) }
27 let raw = substart(&main);
35 impl Drop for Thread {
37 unsafe { rust_raw_thread_join_delete(self.raw_thread) }
42 pub unsafe fn rust_raw_thread_start(f: &(~fn())) -> *raw_thread;
43 pub unsafe fn rust_raw_thread_join_delete(thread: *raw_thread);