Skip to content

Commit eb26567

Browse files
authored
fix typo
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.
1 parent 8713f96 commit eb26567

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

posts/inside-rust/2019-10-11-AsyncAwait-Not-Send-Error-Improvements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ async fn bar(x: &Mutex<u32>) {
166166
} // <- `g` is dropped here
167167
```
168168

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

0 commit comments

Comments
 (0)