Created
March 31, 2014 13:16
-
-
Save SiegeLord/9892052 to your computer and use it in GitHub Desktop.
Mutex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test.rs:15:3: 15:4 error: cannot capture variable of type `proc(Test)`, which does not fulfill `Send`, in a bounded closure | |
| test.rs:15 a(Test{ mutex: Arc::new(Mutex::new(())) } ); | |
| ^ | |
| test.rs:15:3: 15:4 note: this closure's environment must satisfy `Send` | |
| test.rs:15 a(Test{ mutex: Arc::new(Mutex::new(())) } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern crate native; | |
| extern crate sync; | |
| use sync::{Arc, Mutex}; | |
| pub struct Test | |
| { | |
| priv mutex: Arc<Mutex<()>>, | |
| } | |
| fn test2(a: proc(Test)) | |
| { | |
| native::task::spawn(proc() | |
| { | |
| a(Test{ mutex: Arc::new(Mutex::new(())) } ); | |
| }); | |
| } | |
| fn main() | |
| { | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment