aboutsummaryrefslogtreecommitdiff
path: root/src/platform/windows/win_thread.c
diff options
context:
space:
mode:
authorEdward Rudd <urkle@outoforder.cc>2021-12-08 16:30:46 -0500
committerGitHub <noreply@github.com>2021-12-08 16:30:46 -0500
commit317fdb2ff02c98d88a3950791e938b1db3cca1cd (patch)
tree7fc9cbce528276f577feab85c6de0b111d0560e3 /src/platform/windows/win_thread.c
parent2884fb552c9fb347a4dbca21d1b641c447f4aeee (diff)
downloadnng-317fdb2ff02c98d88a3950791e938b1db3cca1cd.tar.gz
nng-317fdb2ff02c98d88a3950791e938b1db3cca1cd.tar.bz2
nng-317fdb2ff02c98d88a3950791e938b1db3cca1cd.zip
Fixes compiling on windows 32-bit (#1549)
* use correct LONG type for nni_atomic_flag on win32 * use InterlockExchangeAdd for nni_atomic_get_bool - this is equivelent to InterlockAdd for the purposes of this call (since it is adding 0) - this allows the code to compile on 32bit windows
Diffstat (limited to 'src/platform/windows/win_thread.c')
-rw-r--r--src/platform/windows/win_thread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platform/windows/win_thread.c b/src/platform/windows/win_thread.c
index b131c067..f9376c40 100644
--- a/src/platform/windows/win_thread.c
+++ b/src/platform/windows/win_thread.c
@@ -180,7 +180,7 @@ nni_atomic_set_bool(nni_atomic_bool *v, bool b)
bool
nni_atomic_get_bool(nni_atomic_bool *v)
{
- return ((bool) InterlockedAdd(&v->v, 0));
+ return ((bool) InterlockedExchangeAdd(&v->v, 0));
}
bool