title: Are +=, |=, &= etc atomic?
body: <p>Are the "modify" operators like <code>+=</code>, <code>|=</code>, <code>&amp;=</code> etc atomic?</p>
  
  <p>I know <code>++</code> is atomic (if you perform <code>x++;</code> in two different threads "simultaneously", you will always end up with <code>x</code> increased by 2, as opposed to <code>x=x+1</code> with optimization switched off.)</p>
  
  <p>What I wonder is whether <code>variable |= constant</code>, and the likes are thread-safe or do I have to protect them with a mutex?</p>
  
  <p>(...or is it CPU-dependent? In this case, how is it on ARM?)</p>