From be5c0e8bae8d478e1b9cc6029dfe5b98e161d562 Mon Sep 17 00:00:00 2001 From: LukeMathWalker <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:53:53 +0200 Subject: [PATCH] Reword 'static issues. Closes #117 --- book/src/07_threads/10_patch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/src/07_threads/10_patch.md b/book/src/07_threads/10_patch.md index db081e9..58257e9 100644 --- a/book/src/07_threads/10_patch.md +++ b/book/src/07_threads/10_patch.md @@ -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.