Use InterlockedExchangeAdd on Windows

This commit is contained in:
Matt Pharr
2011-09-29 16:19:59 -07:00
parent 9ed07ff2b5
commit 8f3e46f67e

View File

@@ -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