24 Jan
2007
24 Jan
'07
3:18 a.m.
And one more... "Damjan Jovanovic" <damjan.jov(a)gmail.com> wrote:
+__int64 interlocked_cmpxchg64( __int64 **dest, __int64 *xchg, __int64 *compare ) +{ + _lwp_mutex_lock( &interlocked_mutex ); + if (memcmp(*dest, compare, 8) == 0) + memcpy(*dest, xchg, 8); + else + memcpy(compare, *dest); + _lwp_mutex_unlock( &interlocked_mutex ); + return compare; +}
Is there any particular reason that you use memcmp/memcpy instead of directly manipulating 64-bit values? -- Dmitry.