title: D function using the x86 CMPXCHG Compare-and-swap
body: <p>I'm looking for a function that presents a high level <a href="http://www.digitalmars.com/d/1.0/" rel="nofollow noreferrer">D</a> interface to an <a href="http://en.wikipedia.org/wiki/Compare-and-swap" rel="nofollow noreferrer">atomic CAS</a> on Intel x86.</p>
  
  <p>I know I can do it with inline ASM (and if needed I will), but I'd rather just grab code from someone else if I can.</p>