Re:There's No Such Thing as “Implicitly Atomic”
by _nalply on Thursday October 05, 2023 @04:12PM
(#37783698)
Why didn't you use a Mutex?
[ Parent
| on HN ]
Re:There's No Such Thing as “Implicitly Atomic”
by kevincox on Thursday October 05, 2023 @04:16PM
(#37783744)
What are you thinking?
I could have used a Mutex then cast the `&Mutex` to `&mut Mutex` so that I could call `.get_mut()`. But this didn't seem simpler.
Re:There's No Such Thing as “Implicitly Atomic”
by _nalply on Thursday October 05, 2023 @04:34PM
(#37783948)
I wanted to avoid unsafe.
Because unsafe introduces conceptual complications and it seemed to be simpler to avoid that in an example.