Reword 'static issues. Closes #117
authorLukeMathWalker <20745048+LukeMathWalker@users.noreply.github.com>
Thu, 1 Aug 2024 12:53:53 +0000 (14:53 +0200)
committerLukeMathWalker <20745048+LukeMathWalker@users.noreply.github.com>
Thu, 1 Aug 2024 12:53:53 +0000 (14:53 +0200)
book/src/07_threads/10_patch.md

index db081e9..58257e9 100644 (file)
@@ -10,9 +10,9 @@ In the non-threaded version of the system, updates were fairly straightforward:
 
 ## Multithreaded updates
 
-The same strategy won't work in the current multi-threaded version,
-because the mutable reference would have to be sent over a channel. The borrow checker would
-stop us, because `&mut Ticket` doesn't satisfy the `'static` lifetime requirement of `SyncSender::send`.
+The same strategy won't work in the current multithreaded version. The borrow checker would
+stop us: `SyncSender<&mut Ticket>` isn't `'static` because `&mut Ticket` doesn't satisfy the `'static` lifetime, therefore
+they can't be captured by the closure that gets passed to `std::thread::spawn`.
 
 There are a few ways to work around this limitation. We'll explore a few of them in the following exercises.