Atomics

Monday, February 8, 2010
A fairly rudimentary AtomicInt type:

def testAtomicInt {
  var a = AtomicInt32(0);
  assertFalse(a.cas(1, 1));
  assertEq(0, a.value);
  assertTrue(a.cas(0, 1));
  assertEq(1, a.value);
}

0 comments:

Post a Comment