Reword 'static issues. Closes #117

This commit is contained in:
LukeMathWalker 2024-08-01 14:53:53 +02:00
parent a6056381bd
commit be5c0e8bae
1 changed files with 3 additions and 3 deletions

View 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.