Closed
Description
use std::thread;
use std::thread::JoinGuard;
use std::collections::HashMap;
use std::sync::{Mutex,Arc};
fn main() {
let join_guards:Arc<Mutex<HashMap<u64, JoinGuard<'static,()>>>> = Arc::new(Mutex::new(HashMap::new()));
let join_guard = thread::scoped(move||{
while join_guards.lock().unwrap().len() != 0{
//...
}
});
}
The above code compiles fine using the latest nightly build on Ubuntu (rustc 1.0.0-nightly (e6a812402 2015-04-14) (built 2015-04-14)
)
but gets the following error on Windows 8 (same rustc version)
src\main.rs:11:19: 11:33 error: the trait `core::marker::Send` is not implemented for the type `*mut libc::types::common
::c95::c_void` [E0277]
src\main.rs:11 let join_guard = thread::scoped(move||{
^~~~~~~~~~~~~~
src\main.rs:11:19: 11:33 note: `*mut libc::types::common::c95::c_void` cannot be sent between threads safely
src\main.rs:11 let join_guard = thread::scoped(move||{
^~~~~~~~~~~~~~
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
No labels