From 00e32618c0f08f314e191655e373452891213ee5 Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Wed, 15 Jul 2009 11:23:42 -0400 Subject: [PATCH] Use InterlockedExchangeAdd() instead of InterlockedAdd() on Windows InterlockedAdd() is not supported on all the platforms we wish to support. However, InterlockedExchangeAdd() is. The two functions are semantically similar with the exception that InterlockedExchangeAdd() returns the initial value of the object being modified while InterlockedAdd() returns the resulting value. Since the return value of the rx_MutexAdd() macro is unused, this is irrelevant. Reviewed-on: http://gerrit.openafs.org/98 Verified-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/rx/rx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rx/rx.h b/src/rx/rx.h index ba9537f16..5e2550bfc 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -1087,7 +1087,7 @@ typedef struct rx_interface_stat { extern int rx_DumpCalls(FILE *outputFile, char *cookie); #define rx_MutexIncrement(object, mutex) InterlockedIncrement(&object) -#define rx_MutexAdd(object, addend, mutex) InterlockedAdd(&object, addend) +#define rx_MutexAdd(object, addend, mutex) InterlockedExchangeAdd(&object, addend) #define rx_MutexDecrement(object, mutex) InterlockedDecrement(&object) #define rx_MutexAdd1Increment2(object1, addend, object2, mutex) \ do { \ -- 2.39.5