From 3755ac10b3a18192c3bddbe9649239402f5baa83 Mon Sep 17 00:00:00 2001 From: jjenista Date: Tue, 9 Nov 2010 02:25:37 +0000 Subject: [PATCH] just an explanation of LOCKXCH --- Robust/src/Runtime/mlp_lock.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Robust/src/Runtime/mlp_lock.h b/Robust/src/Runtime/mlp_lock.h index d462534b..46d8a930 100644 --- a/Robust/src/Runtime/mlp_lock.h +++ b/Robust/src/Runtime/mlp_lock.h @@ -61,6 +61,11 @@ static inline int LOCKXCHG32(volatile int* ptr, int val){ } + +// LOCKXCH atomically does the following: +// INTPTR retval=*ptr; +// *ptr=val; +// return retval #ifdef BIT64 static inline INTPTR LOCKXCHG(volatile INTPTR * ptr, INTPTR val){ INTPTR retval; -- 2.34.1