Skip to content

Instantly share code, notes, and snippets.

@SiegeLord
Created March 31, 2014 13:16
Show Gist options
  • Select an option

  • Save SiegeLord/9892052 to your computer and use it in GitHub Desktop.

Select an option

Save SiegeLord/9892052 to your computer and use it in GitHub Desktop.
Mutex
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(())) } );
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