Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Code shared from the Rust Playground
struct Inner {
a: A,
impl Inner {
fn fun(&mut self) {
fn fun2(&mut self, outer: &Arc<Outer>) {
struct Outer {
b: B,
inner: Mutex<Inner>,
impl Outer {
fn mainfun(self: Arc<Self>) {
let mut inner = self.inner.lock();
// do something with held locks
// do something more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.