n3 variables: A, B, C which are shared by thread T1 and
thread T2
nT1 computes C = A+B
nT2 transfers amount X from A to B
uT2 must do: A = A -X and B = B+X (so that A+B is
unchanged)
nBut if T1 computes A+B after T2 has done A = A-X but
before B = B+X
nthen T1 will not obtain the correct result for C = A + B