Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
If I'm reading the code correctly, and if I understand the Sync requirement correctly, the problem here is that bar() _locks_ the mutex, not that bar() unlocks the mutex.
  • Loading branch information
qutesy committed Oct 13, 2019
1 parent 8713f96 commit eb26567
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async fn bar(x: &Mutex<u32>) {
} // <- `g` is dropped here
```

`bar` unlocks the mutex before `await`ing `baz`. `std::sync::MutexGuard<u32>` does not implement
`bar` locks the mutex before `await`ing `baz`. `std::sync::MutexGuard<u32>` does not implement
`Send` and lives across the `baz().await` point (because `g` is dropped at the end of the scope)
which causes the entire future not to implement `Send`.

Expand Down

0 comments on commit eb26567

Please sign in to comment.