aboutsummaryrefslogtreecommitdiffstats
path: root/erts/include/internal/gcc
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2010-12-03 10:57:26 +0100
committerRickard Green <[email protected]>2010-12-11 03:03:19 +0100
commitb297bfdd47b0a39831d8cc2541aeb910f9af0bca (patch)
tree59ac65b0d0bc95879d9507900781acdc4911bc3b /erts/include/internal/gcc
parent99e34bba1a60b262e24496cc9288b549360c6377 (diff)
downloadotp-b297bfdd47b0a39831d8cc2541aeb910f9af0bca.tar.gz
otp-b297bfdd47b0a39831d8cc2541aeb910f9af0bca.tar.bz2
otp-b297bfdd47b0a39831d8cc2541aeb910f9af0bca.zip
Introduce ethr_sint_t and use it for atomics
The atomic memory operations interface used the 'long' type and assumed that it was of the same size as 'void *'. This is true on most platforms, however, not on Windows 64.
Diffstat (limited to 'erts/include/internal/gcc')
-rw-r--r--erts/include/internal/gcc/ethr_atomic.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/include/internal/gcc/ethr_atomic.h b/erts/include/internal/gcc/ethr_atomic.h
index e8e529dd48..49a8ceeab1 100644
--- a/erts/include/internal/gcc/ethr_atomic.h
+++ b/erts/include/internal/gcc/ethr_atomic.h
@@ -36,11 +36,14 @@
# define ETHR_IMMED_ATOMIC_SET_GET_SAFE__ 1
#endif
+#if ETHR_SIZEOF_LONG != ETHR_SIZEOF_PTR
+# error "Incompatible size of 'long'"
+#endif
+
typedef struct {
volatile long counter;
} ethr_native_atomic_t;
-
/*
* According to the documentation this is what we want:
* #define ETHR_MEMORY_BARRIER __sync_synchronize()