The method takes an &self, but it reads the current register value, modifies it, and then writes the value. This can cause a race condition, right? Because the method kind of implies that it's an atomic operation when it isn't, so it could cause unexpected results if for some reason people call it from multiple threads at the same time.
The method takes an
&self, but it reads the current register value, modifies it, and then writes the value. This can cause a race condition, right? Because the method kind of implies that it's an atomic operation when it isn't, so it could cause unexpected results if for some reason people call it from multiple threads at the same time.