Skip to content

Instantly share code, notes, and snippets.

@erickt
Created July 30, 2018 16:50
Show Gist options
  • Save erickt/748296103d3037b9b916956d4c9cc926 to your computer and use it in GitHub Desktop.
Save erickt/748296103d3037b9b916956d4c9cc926 to your computer and use it in GitHub Desktop.
struct Foo {
things: Arc<Mutex<Thing>>,
}
impl Foo {
async fn foo(&self) {
let things = things.lock().unwrap();
await!(self.bar())
...
}
async fn bar(&self) {
let things = things.lock().unwrap();
....
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment