threadpool/
threadpool.rs

1extern crate transportation;
2
3fn main() {
4	let child = ::std::thread::spawn(|| ::transportation::run_worker()).thread().id();
5	::transportation::run_in_thread(child, || {
6		::transportation::set_timeout(|| eprintln!("Child!"), ::std::time::Duration::from_secs(1));
7	}).unwrap();
8	::std::thread::sleep(::std::time::Duration::from_secs(2));
9	::transportation::run_in_thread(child, || ::transportation::stop()).unwrap();
10	::std::thread::sleep(::std::time::Duration::from_secs(2));
11	eprintln!("{:?}", ::transportation::run_in_thread(child, || eprintln!("Alive")));
12}