thread-safe way to pass borrow to thread::spawn
NEED nightly rust!
test bench::benchborrowedthread ... bench: 18,902 ns/iter (+/- 690)
test bench::benchstdthread ... bench: 18,859 ns/iter (+/- 684)
```rust use borrowed_thread;
let mut owned = "ABC".to_owned();
let borrowedhandle = borrowedthread::spawn(|| { owned.push('D'); 0 });
let ret = borrowed_handle.join().expect("join err");
asserteq!(0, ret); asserteq!("ABCD", owned); ```
```rust use borrowed_thread;
let owned = "ABC".to_owned();
let borrowedhandle = borrowedthread::spawn(|| { assert_eq!("ABC", owned); 0 });
let ret = borrowed_handle.join().expect("join err");
assert_eq!(0, ret); ```
```rust let mut owned = "ABC".to_owned();
let borrowedhandle = borrowedthread::spawn(|| { owned.push('D'); 0 });
// this will cause panic! drop(borrowed_handle);
assert_eq!("ABCD", owned); ```