Eikthrynir wrote:
1. You call InterlockedExchange64 with a_pi64Value as the first parameter, so the __int64 variable pointed by a_pi64Value gets 0. Then, you return the previous value of that __int64 variable which is certainly not the one we are interested in, m_i64Value.
If the 64 bit integer variable you want to read atomically is m_i64Value Then the correct way to atomically read the value is:__int64 i64Val = InterlockedExchangeAdd64(m_i64Value,0);
Eikthrynir wrote:
2. GetValue returns a LONGLONG value, so we find ourselves in exactly the same situation from Question 2 (concerning the EAX and EDX registers)...
This statement does not make any sense to me. Best Wishes, -David Delaune