2 ms·
That's not accurate. You can mutate via shared reference too, as long as something ensures it's still thread safe (e.g. synchronized). There's UnsafeCell type
by pornel 4y ago
That's not accurate. You can mutate via shared reference too, as long as something ensures it's still thread safe (e.g. synchronized).
There's UnsafeCell type that is a deliberate loophole in immutability of types behind shared references. It's used as the basis for atomic access and mutexes.