1 的序列(c = b + a 实现为 c = b, c += a):
(a<b) false // thread 1 a == 4, b == 0
else // thread 1
c = b + ... // thread 1 c = b == 0
b = 10 // thread 2
c = -3 // thread 2 c = -3
c = ... + a // thread 1 c += a == 1
4 的序列
(a<b) false // thread 1 a == 4, b == 0
a + b // thread 1 sum of 4 + 0 = 4
b = 10 // thread 2
c = -3 // thread 2
c = a + b // thread 1 c = previously calculated sum of 4
-3 的序列
... // thread 1 runs first
c = -3 // thread 2, last statement
13 的序列
... // thread 1 is going to calculate c = a, c = b - c
c = 4 // thread 1 c = a
b = 10 // thread 2
c = -3 // thread 2
c = b - c // thread 1 c = 10 - (-3) = 13
6 的序列
b = 10 // thread 2
c = -3 // thread 2
(a<b) true // thread 1
c = b-a // thread 1 c = 10 - 4 = 6
14 的序列
(a<b) false // thread 1
b = 10 // thread 2
c = -3 // thread 2
c = b+a // thread 1 c = 10 + 4 = 14
7 的序列(c = b + a 实现为 c = a, c += b):
(a<b) true // thread 1
c = a // thread 1 c = 4
b = 10 // thread 2
c = -3 // thread 2
c += b // thread 1 c = -3 + 10 = 7