3 ms·
Because an atomic provides interior mutability for `usize`. (It's a hack that plays on the GP's specific example of a counter. It doesn't generalize arbitraril
by burntsushi 10y ago
Because an atomic provides interior mutability for `usize`.
(It's a hack that plays on the GP's specific example of a counter. It doesn't generalize arbitrarily to removing use of RefCell for thread locals in safe code.)