The docs say that “atomicState.counter = atomicState.counter + 1” should work. If this is right that means it is executing a read and write atomically. In another forum post the response seemed to be the sequential reads could have asynchronous modifications by between them. So I’m guessing something like:
def saved = atomicState.counter saved = saved + 1 atomicState.counter = saved
would not work right.
So how is it deciding when to execute some statements atomically? If all the access is in the same statement will that work? What about multiple fields, will atomicState.a = atomicState.a + atomicState.b work?