|
|
|
|
|
by VonTum
66 days ago
|
|
If you want to spawn multiple threads, all with access to a mutex, but without putting it behind an Arc, then you can simply spawn all your threads in a std::thread::scope(||{...}). These let you pass references &'scope Mutex<...>
I find Rc or Arc almost never the right tool for a job where I want to "share state" or such |
|