From 8f3e46f67e461f15f7060e1305773ed42f3ce67c Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Thu, 29 Sep 2011 16:19:59 -0700 Subject: [PATCH] Use InterlockedExchangeAdd on Windows --- examples/taskinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/taskinfo.h b/examples/taskinfo.h index 4806bdaa..2a5daaf4 100644 --- a/examples/taskinfo.h +++ b/examples/taskinfo.h @@ -146,7 +146,7 @@ lInitTaskInfo() { static inline TaskInfo * lGetTaskInfo() { #ifdef ISPC_IS_WINDOWS - int myCoord = InterlockedAdd(&nextTaskInfoCoordinate, 1)-1; + int myCoord = InterlockedExchangeAdd(&nextTaskInfoCoordinate, 1); #else int myCoord = lAtomicAdd32(&nextTaskInfoCoordinate, 1); #endif