33#if _MSC_VER <= 1400 || !defined(AO_USE_INTERLOCKED_INTRINSICS) \
34 || defined(_WIN32_WCE)
43#if _MSC_VER < 1310 || !defined(AO_USE_INTERLOCKED_INTRINSICS)
45# define _InterlockedIncrement InterlockedIncrement
46# define _InterlockedDecrement InterlockedDecrement
47# define _InterlockedExchangeAdd InterlockedExchangeAdd
48# define _InterlockedCompareExchange InterlockedCompareExchange
50# define AO_INTERLOCKED_VOLATILE
73# if !defined(AO_PREFER_GENERALIZED) || !defined(AO_ASSUME_WINDOWS98)
74# pragma intrinsic (_InterlockedIncrement)
75# pragma intrinsic (_InterlockedDecrement)
76# pragma intrinsic (_InterlockedExchangeAdd)
78# pragma intrinsic (_InterlockedIncrement64)
79# pragma intrinsic (_InterlockedDecrement64)
80# pragma intrinsic (_InterlockedExchangeAdd64)
84# pragma intrinsic (_InterlockedCompareExchange)
86# pragma intrinsic (_InterlockedCompareExchange64)
89# define AO_INTERLOCKED_VOLATILE volatile
93#if !defined(AO_PREFER_GENERALIZED) || !defined(AO_ASSUME_WINDOWS98)
100 return _InterlockedExchangeAdd64((__int64
volatile *)p, incr);
103# define AO_HAVE_fetch_and_add_full
111 return _InterlockedIncrement64((__int64
volatile *)p) - 1;
114# define AO_HAVE_fetch_and_add1_full
122 return _InterlockedDecrement64((__int64
volatile *)p) + 1;
125# define AO_HAVE_fetch_and_sub1_full
133# define AO_HAVE_int_fetch_and_add_full
140# define AO_HAVE_int_fetch_and_add1_full
147# define AO_HAVE_int_fetch_and_sub1_full
151#ifdef AO_ASSUME_WINDOWS98
157 return (
AO_t)_InterlockedCompareExchange64((__int64
volatile *)addr,
159# elif defined(AO_OLD_STYLE_INTERLOCKED_COMPARE_EXCHANGE)
162 (
void *)new_val, (
void *)old_val);
168# define AO_HAVE_fetch_compare_and_swap_full
173 unsigned int old_val,
174 unsigned int new_val)
179# define AO_HAVE_int_fetch_compare_and_swap_full
183#if (_MSC_VER > 1400) && (!defined(_M_ARM) || _MSC_VER >= 1800)
185# if _MSC_VER < 1800 || !defined(AO_PREFER_GENERALIZED)
186# pragma intrinsic (_InterlockedAnd8)
187# pragma intrinsic (_InterlockedOr8)
188# pragma intrinsic (_InterlockedXor8)
193 _InterlockedAnd8((
char volatile *)p, value);
195# define AO_HAVE_char_and_full
200 _InterlockedOr8((
char volatile *)p, value);
202# define AO_HAVE_char_or_full
207 _InterlockedXor8((
char volatile *)p, value);
209# define AO_HAVE_char_xor_full
212# pragma intrinsic (_InterlockedCompareExchange16)
216 unsigned short old_val,
217 unsigned short new_val)
219 return _InterlockedCompareExchange16((
short volatile *)addr,
222# define AO_HAVE_short_fetch_compare_and_swap_full
224# ifndef AO_PREFER_GENERALIZED
225# pragma intrinsic (_InterlockedIncrement16)
226# pragma intrinsic (_InterlockedDecrement16)
229 AO_short_fetch_and_add1_full(
volatile unsigned short *p)
231 return _InterlockedIncrement16((
short volatile *)p) - 1;
233# define AO_HAVE_short_fetch_and_add1_full
236 AO_short_fetch_and_sub1_full(
volatile unsigned short *p)
238 return _InterlockedDecrement16((
short volatile *)p) + 1;
240# define AO_HAVE_short_fetch_and_sub1_full
247# ifndef AO_PREFER_GENERALIZED
248# pragma intrinsic (_InterlockedAnd16)
249# pragma intrinsic (_InterlockedOr16)
250# pragma intrinsic (_InterlockedXor16)
255 (void)_InterlockedAnd16((
short volatile *)p, value);
257# define AO_HAVE_short_and_full
262 (void)_InterlockedOr16((
short volatile *)p, value);
264# define AO_HAVE_short_or_full
269 (void)_InterlockedXor16((
short volatile *)p, value);
271# define AO_HAVE_short_xor_full
273# pragma intrinsic (_InterlockedAnd)
274# pragma intrinsic (_InterlockedOr)
275# pragma intrinsic (_InterlockedXor)
281 (void)_InterlockedAnd((
long volatile *)p, value);
283# define AO_HAVE_int_and_full
288 (void)_InterlockedOr((
long volatile *)p, value);
290# define AO_HAVE_int_or_full
295 (void)_InterlockedXor((
long volatile *)p, value);
297# define AO_HAVE_int_xor_full
299# pragma intrinsic (_InterlockedAnd64)
300# pragma intrinsic (_InterlockedOr64)
301# pragma intrinsic (_InterlockedXor64)
308 (void)_InterlockedAnd((
long volatile *)p, value);
310 (void)_InterlockedAnd64((__int64
volatile *)p, value);
313# define AO_HAVE_and_full
319 (void)_InterlockedOr((
long volatile *)p, value);
321 (void)_InterlockedOr64((__int64
volatile *)p, value);
324# define AO_HAVE_or_full
330 (void)_InterlockedXor((
long volatile *)p, value);
332 (void)_InterlockedXor64((__int64
volatile *)p, value);
335# define AO_HAVE_xor_full
338# if !defined(AO_PREFER_GENERALIZED) && (defined(_M_ARM) || defined(_M_ARM64))
339# pragma intrinsic (_InterlockedAnd8_acq)
340# pragma intrinsic (_InterlockedAnd8_nf)
341# pragma intrinsic (_InterlockedAnd8_rel)
342# pragma intrinsic (_InterlockedOr8_acq)
343# pragma intrinsic (_InterlockedOr8_nf)
344# pragma intrinsic (_InterlockedOr8_rel)
345# pragma intrinsic (_InterlockedXor8_acq)
346# pragma intrinsic (_InterlockedXor8_nf)
347# pragma intrinsic (_InterlockedXor8_rel)
350 AO_char_and(
volatile unsigned char *p,
unsigned char value)
352 _InterlockedAnd8_nf((
char volatile *)p, value);
354# define AO_HAVE_char_and
357 AO_char_or(
volatile unsigned char *p,
unsigned char value)
359 _InterlockedOr8_nf((
char volatile *)p, value);
361# define AO_HAVE_char_or
364 AO_char_xor(
volatile unsigned char *p,
unsigned char value)
366 _InterlockedXor8_nf((
char volatile *)p, value);
368# define AO_HAVE_char_xor
373 _InterlockedAnd8_acq((
char volatile *)p, value);
375# define AO_HAVE_char_and_acquire
380 _InterlockedOr8_acq((
char volatile *)p, value);
382# define AO_HAVE_char_or_acquire
387 _InterlockedXor8_acq((
char volatile *)p, value);
389# define AO_HAVE_char_xor_acquire
394 _InterlockedAnd8_rel((
char volatile *)p, value);
396# define AO_HAVE_char_and_release
401 _InterlockedOr8_rel((
char volatile *)p, value);
403# define AO_HAVE_char_or_release
408 _InterlockedXor8_rel((
char volatile *)p, value);
410# define AO_HAVE_char_xor_release
412# pragma intrinsic (_InterlockedAnd16_acq)
413# pragma intrinsic (_InterlockedAnd16_nf)
414# pragma intrinsic (_InterlockedAnd16_rel)
415# pragma intrinsic (_InterlockedOr16_acq)
416# pragma intrinsic (_InterlockedOr16_nf)
417# pragma intrinsic (_InterlockedOr16_rel)
418# pragma intrinsic (_InterlockedXor16_acq)
419# pragma intrinsic (_InterlockedXor16_nf)
420# pragma intrinsic (_InterlockedXor16_rel)
423 AO_short_and(
volatile unsigned short *p,
unsigned short value)
425 (void)_InterlockedAnd16_nf((
short volatile *)p, value);
427# define AO_HAVE_short_and
430 AO_short_or(
volatile unsigned short *p,
unsigned short value)
432 (void)_InterlockedOr16_nf((
short volatile *)p, value);
434# define AO_HAVE_short_or
437 AO_short_xor(
volatile unsigned short *p,
unsigned short value)
439 (void)_InterlockedXor16_nf((
short volatile *)p, value);
441# define AO_HAVE_short_xor
446 (void)_InterlockedAnd16_acq((
short volatile *)p, value);
448# define AO_HAVE_short_and_acquire
453 (void)_InterlockedOr16_acq((
short volatile *)p, value);
455# define AO_HAVE_short_or_acquire
460 (void)_InterlockedXor16_acq((
short volatile *)p, value);
462# define AO_HAVE_short_xor_acquire
467 (void)_InterlockedAnd16_rel((
short volatile *)p, value);
469# define AO_HAVE_short_and_release
474 (void)_InterlockedOr16_rel((
short volatile *)p, value);
476# define AO_HAVE_short_or_release
481 (void)_InterlockedXor16_rel((
short volatile *)p, value);
483# define AO_HAVE_short_xor_release
485# pragma intrinsic (_InterlockedAnd_acq)
486# pragma intrinsic (_InterlockedAnd_nf)
487# pragma intrinsic (_InterlockedAnd_rel)
488# pragma intrinsic (_InterlockedOr_acq)
489# pragma intrinsic (_InterlockedOr_nf)
490# pragma intrinsic (_InterlockedOr_rel)
491# pragma intrinsic (_InterlockedXor_acq)
492# pragma intrinsic (_InterlockedXor_nf)
493# pragma intrinsic (_InterlockedXor_rel)
497 AO_int_and(
volatile unsigned int *p,
unsigned int value)
499 (void)_InterlockedAnd_nf((
long volatile *)p, value);
501# define AO_HAVE_int_and
504 AO_int_or(
volatile unsigned int *p,
unsigned int value)
506 (void)_InterlockedOr_nf((
long volatile *)p, value);
508# define AO_HAVE_int_or
511 AO_int_xor(
volatile unsigned int *p,
unsigned int value)
513 (void)_InterlockedXor_nf((
long volatile *)p, value);
515# define AO_HAVE_int_xor
520 (void)_InterlockedAnd_acq((
long volatile *)p, value);
522# define AO_HAVE_int_and_acquire
527 (void)_InterlockedOr_acq((
long volatile *)p, value);
529# define AO_HAVE_int_or_acquire
534 (void)_InterlockedXor_acq((
long volatile *)p, value);
536# define AO_HAVE_int_xor_acquire
541 (void)_InterlockedAnd_rel((
long volatile *)p, value);
543# define AO_HAVE_int_and_release
548 (void)_InterlockedOr_rel((
long volatile *)p, value);
550# define AO_HAVE_int_or_release
555 (void)_InterlockedXor_rel((
long volatile *)p, value);
557# define AO_HAVE_int_xor_release
559# pragma intrinsic (_InterlockedAnd64_acq)
560# pragma intrinsic (_InterlockedAnd64_nf)
561# pragma intrinsic (_InterlockedAnd64_rel)
562# pragma intrinsic (_InterlockedOr64_acq)
563# pragma intrinsic (_InterlockedOr64_nf)
564# pragma intrinsic (_InterlockedOr64_rel)
565# pragma intrinsic (_InterlockedXor64_acq)
566# pragma intrinsic (_InterlockedXor64_nf)
567# pragma intrinsic (_InterlockedXor64_rel)
574 (void)_InterlockedAnd_nf((
long volatile *)p, value);
576 (void)_InterlockedAnd64_nf((__int64
volatile *)p, value);
585 (void)_InterlockedOr_nf((
long volatile *)p, value);
587 (void)_InterlockedOr64_nf((__int64
volatile *)p, value);
596 (void)_InterlockedXor_nf((
long volatile *)p, value);
598 (void)_InterlockedXor64_nf((__int64
volatile *)p, value);
607 (void)_InterlockedAnd_acq((
long volatile *)p, value);
609 (void)_InterlockedAnd64_acq((__int64
volatile *)p, value);
612# define AO_HAVE_and_acquire
618 (void)_InterlockedOr_acq((
long volatile *)p, value);
620 (void)_InterlockedOr64_acq((__int64
volatile *)p, value);
623# define AO_HAVE_or_acquire
629 (void)_InterlockedXor_acq((
long volatile *)p, value);
631 (void)_InterlockedXor64_acq((__int64
volatile *)p, value);
634# define AO_HAVE_xor_acquire
640 (void)_InterlockedAnd_rel((
long volatile *)p, value);
642 (void)_InterlockedAnd64_rel((__int64
volatile *)p, value);
645# define AO_HAVE_and_release
651 (void)_InterlockedOr_rel((
long volatile *)p, value);
653 (void)_InterlockedOr64_rel((__int64
volatile *)p, value);
656# define AO_HAVE_or_release
662 (void)_InterlockedXor_rel((
long volatile *)p, value);
664 (void)_InterlockedXor64_rel((__int64
volatile *)p, value);
667# define AO_HAVE_xor_release
669# pragma intrinsic (_InterlockedDecrement16_acq)
670# pragma intrinsic (_InterlockedDecrement16_nf)
671# pragma intrinsic (_InterlockedDecrement16_rel)
672# pragma intrinsic (_InterlockedIncrement16_acq)
673# pragma intrinsic (_InterlockedIncrement16_nf)
674# pragma intrinsic (_InterlockedIncrement16_rel)
677 AO_short_fetch_and_add1(
volatile unsigned short *p)
679 return _InterlockedIncrement16_nf((
short volatile *)p) - 1;
681# define AO_HAVE_short_fetch_and_add1
684 AO_short_fetch_and_sub1(
volatile unsigned short *p)
686 return _InterlockedDecrement16_nf((
short volatile *)p) + 1;
688# define AO_HAVE_short_fetch_and_sub1
691 AO_short_fetch_and_add1_acquire(
volatile unsigned short *p)
693 return _InterlockedIncrement16_acq((
short volatile *)p) - 1;
695# define AO_HAVE_short_fetch_and_add1_acquire
698 AO_short_fetch_and_sub1_acquire(
volatile unsigned short *p)
700 return _InterlockedDecrement16_acq((
short volatile *)p) + 1;
702# define AO_HAVE_short_fetch_and_sub1_acquire
705 AO_short_fetch_and_add1_release(
volatile unsigned short *p)
707 return _InterlockedIncrement16_rel((
short volatile *)p) - 1;
709# define AO_HAVE_short_fetch_and_add1_release
712 AO_short_fetch_and_sub1_release(
volatile unsigned short *p)
714 return _InterlockedDecrement16_rel((
short volatile *)p) + 1;
716# define AO_HAVE_short_fetch_and_sub1_release
718# pragma intrinsic (_InterlockedExchangeAdd_acq)
719# pragma intrinsic (_InterlockedExchangeAdd_nf)
720# pragma intrinsic (_InterlockedExchangeAdd_rel)
722# pragma intrinsic (_InterlockedDecrement_acq)
723# pragma intrinsic (_InterlockedDecrement_nf)
724# pragma intrinsic (_InterlockedDecrement_rel)
725# pragma intrinsic (_InterlockedIncrement_acq)
726# pragma intrinsic (_InterlockedIncrement_nf)
727# pragma intrinsic (_InterlockedIncrement_rel)
730# pragma intrinsic (_InterlockedExchangeAdd64_acq)
731# pragma intrinsic (_InterlockedExchangeAdd64_nf)
732# pragma intrinsic (_InterlockedExchangeAdd64_rel)
734# pragma intrinsic (_InterlockedDecrement64_acq)
735# pragma intrinsic (_InterlockedDecrement64_nf)
736# pragma intrinsic (_InterlockedDecrement64_rel)
737# pragma intrinsic (_InterlockedIncrement64_acq)
738# pragma intrinsic (_InterlockedIncrement64_nf)
739# pragma intrinsic (_InterlockedIncrement64_rel)
746 return _InterlockedExchangeAdd_nf((
long volatile *)p, incr);
748 return _InterlockedExchangeAdd64_nf((__int64
volatile *)p, incr);
751# define AO_HAVE_fetch_and_add
757 return _InterlockedIncrement_nf((
long volatile *)p) - 1;
759 return _InterlockedIncrement64_nf((__int64
volatile *)p) - 1;
762# define AO_HAVE_fetch_and_add1
768 return _InterlockedDecrement_nf((
long volatile *)p) + 1;
770 return _InterlockedDecrement64_nf((__int64
volatile *)p) + 1;
773# define AO_HAVE_fetch_and_sub1
779 return _InterlockedExchangeAdd_acq((
long volatile *)p, incr);
781 return _InterlockedExchangeAdd64_acq((__int64
volatile *)p, incr);
784# define AO_HAVE_fetch_and_add_acquire
790 return _InterlockedIncrement_acq((
long volatile *)p) - 1;
792 return _InterlockedIncrement64_acq((__int64
volatile *)p) - 1;
795# define AO_HAVE_fetch_and_add1_acquire
801 return _InterlockedDecrement_acq((
long volatile *)p) + 1;
803 return _InterlockedDecrement64_acq((__int64
volatile *)p) + 1;
806# define AO_HAVE_fetch_and_sub1_acquire
812 return _InterlockedExchangeAdd_rel((
long volatile *)p, incr);
814 return _InterlockedExchangeAdd64_rel((__int64
volatile *)p, incr);
817# define AO_HAVE_fetch_and_add_release
823 return _InterlockedIncrement_rel((
long volatile *)p) - 1;
825 return _InterlockedIncrement64_rel((__int64
volatile *)p) - 1;
828# define AO_HAVE_fetch_and_add1_release
834 return _InterlockedDecrement_rel((
long volatile *)p) + 1;
836 return _InterlockedDecrement64_rel((__int64
volatile *)p) + 1;
839# define AO_HAVE_fetch_and_sub1_release
845 return _InterlockedExchangeAdd_nf((
long volatile *)p, incr);
847# define AO_HAVE_int_fetch_and_add
850 AO_int_fetch_and_add1(
volatile unsigned int *p)
852 return _InterlockedIncrement_nf((
long volatile *)p) - 1;
854# define AO_HAVE_int_fetch_and_add1
857 AO_int_fetch_and_sub1(
volatile unsigned int *p)
859 return _InterlockedDecrement_nf((
long volatile *)p) + 1;
861# define AO_HAVE_int_fetch_and_sub1
867 return _InterlockedExchangeAdd_acq((
long volatile *)p, incr);
869# define AO_HAVE_int_fetch_and_add_acquire
874 return _InterlockedIncrement_acq((
long volatile *)p) - 1;
876# define AO_HAVE_int_fetch_and_add1_acquire
881 return _InterlockedDecrement_acq((
long volatile *)p) + 1;
883# define AO_HAVE_int_fetch_and_sub1_acquire
889 return _InterlockedExchangeAdd_rel((
long volatile *)p, incr);
891# define AO_HAVE_int_fetch_and_add_release
896 return _InterlockedIncrement_rel((
long volatile *)p) - 1;
898# define AO_HAVE_int_fetch_and_add1_release
903 return _InterlockedDecrement_rel((
long volatile *)p) + 1;
905# define AO_HAVE_int_fetch_and_sub1_release
910# pragma intrinsic (_InterlockedCompareExchange8)
914 unsigned char old_val,
915 unsigned char new_val)
917 return _InterlockedCompareExchange8((
char volatile *)addr,
920# define AO_HAVE_char_fetch_compare_and_swap_full
922# if defined(_M_ARM) || defined(_M_ARM64)
924# pragma intrinsic (_InterlockedCompareExchange_acq)
925# pragma intrinsic (_InterlockedCompareExchange_nf)
926# pragma intrinsic (_InterlockedCompareExchange_rel)
928# pragma intrinsic (_InterlockedCompareExchange64_acq)
929# pragma intrinsic (_InterlockedCompareExchange64_nf)
930# pragma intrinsic (_InterlockedCompareExchange64_rel)
937 return _InterlockedCompareExchange_nf((
long volatile *)addr,
940 return (
AO_t)_InterlockedCompareExchange64_nf(
941 (__int64
volatile *)addr, new_val, old_val);
944# define AO_HAVE_fetch_compare_and_swap
951 return _InterlockedCompareExchange_acq((
long volatile *)addr,
954 return (
AO_t)_InterlockedCompareExchange64_acq(
955 (__int64
volatile *)addr, new_val, old_val);
958# define AO_HAVE_fetch_compare_and_swap_acquire
965 return _InterlockedCompareExchange_rel((
long volatile *)addr,
968 return (
AO_t)_InterlockedCompareExchange64_rel(
969 (__int64
volatile *)addr, new_val, old_val);
972# define AO_HAVE_fetch_compare_and_swap_release
976 AO_int_fetch_compare_and_swap(
volatile unsigned int *addr,
977 unsigned int old_val,
978 unsigned int new_val)
980 return _InterlockedCompareExchange_nf((
long volatile *)addr,
983# define AO_HAVE_int_fetch_compare_and_swap
987 unsigned int old_val,
988 unsigned int new_val)
990 return _InterlockedCompareExchange_acq((
long volatile *)addr,
993# define AO_HAVE_int_fetch_compare_and_swap_acquire
997 unsigned int old_val,
998 unsigned int new_val)
1000 return _InterlockedCompareExchange_rel((
long volatile *)addr,
1003# define AO_HAVE_int_fetch_compare_and_swap_release
1006# pragma intrinsic (_InterlockedCompareExchange16_acq)
1007# pragma intrinsic (_InterlockedCompareExchange16_nf)
1008# pragma intrinsic (_InterlockedCompareExchange16_rel)
1009# pragma intrinsic (_InterlockedCompareExchange8_acq)
1010# pragma intrinsic (_InterlockedCompareExchange8_nf)
1011# pragma intrinsic (_InterlockedCompareExchange8_rel)
1014 AO_short_fetch_compare_and_swap(
volatile unsigned short *addr,
1015 unsigned short old_val,
1016 unsigned short new_val)
1018 return _InterlockedCompareExchange16_nf((
short volatile *)addr,
1021# define AO_HAVE_short_fetch_compare_and_swap
1025 unsigned short old_val,
1026 unsigned short new_val)
1028 return _InterlockedCompareExchange16_acq((
short volatile *)addr,
1031# define AO_HAVE_short_fetch_compare_and_swap_acquire
1035 unsigned short old_val,
1036 unsigned short new_val)
1038 return _InterlockedCompareExchange16_rel((
short volatile *)addr,
1041# define AO_HAVE_short_fetch_compare_and_swap_release
1044 AO_char_fetch_compare_and_swap(
volatile unsigned char *addr,
1045 unsigned char old_val,
1046 unsigned char new_val)
1048 return _InterlockedCompareExchange8_nf((
char volatile *)addr,
1051# define AO_HAVE_char_fetch_compare_and_swap
1055 unsigned char old_val,
1056 unsigned char new_val)
1058 return _InterlockedCompareExchange8_acq((
char volatile *)addr,
1061# define AO_HAVE_char_fetch_compare_and_swap_acquire
1065 unsigned char old_val,
1066 unsigned char new_val)
1068 return _InterlockedCompareExchange8_rel((
char volatile *)addr,
1071# define AO_HAVE_char_fetch_compare_and_swap_release
1074# if !defined(AO_PREFER_GENERALIZED) && !defined(_M_ARM)
1075# pragma intrinsic (_InterlockedExchangeAdd16)
1076# pragma intrinsic (_InterlockedExchangeAdd8)
1081 return _InterlockedExchangeAdd8((
char volatile *)p, incr);
1083# define AO_HAVE_char_fetch_and_add_full
1087 unsigned short incr)
1089 return _InterlockedExchangeAdd16((
short volatile *)p, incr);
1091# define AO_HAVE_short_fetch_and_add_full
1093# if defined(_M_ARM64)
1094# pragma intrinsic (_InterlockedExchangeAdd16_acq)
1095# pragma intrinsic (_InterlockedExchangeAdd16_nf)
1096# pragma intrinsic (_InterlockedExchangeAdd16_rel)
1097# pragma intrinsic (_InterlockedExchangeAdd8_acq)
1098# pragma intrinsic (_InterlockedExchangeAdd8_nf)
1099# pragma intrinsic (_InterlockedExchangeAdd8_rel)
1104 return _InterlockedExchangeAdd8_nf((
char volatile *)p, incr);
1106# define AO_HAVE_char_fetch_and_add
1111 return _InterlockedExchangeAdd16_nf((
short volatile *)p, incr);
1113# define AO_HAVE_short_fetch_and_add
1119 return _InterlockedExchangeAdd8_acq((
char volatile *)p, incr);
1121# define AO_HAVE_char_fetch_and_add_acquire
1125 unsigned short incr)
1127 return _InterlockedExchangeAdd16_acq((
short volatile *)p, incr);
1129# define AO_HAVE_short_fetch_and_add_acquire
1135 return _InterlockedExchangeAdd8_rel((
char volatile *)p, incr);
1137# define AO_HAVE_char_fetch_and_add_release
1141 unsigned short incr)
1143 return _InterlockedExchangeAdd16_rel((
short volatile *)p, incr);
1145# define AO_HAVE_short_fetch_and_add_release
1150# if !defined(_M_ARM) || _M_ARM >= 6
1151# include "../test_and_set_t_is_char.h"
1153# pragma intrinsic (_InterlockedExchange8)
1158 return (
AO_TS_VAL_t)(_InterlockedExchange8((
char volatile *)addr,
1164# define AO_HAVE_test_and_set_full
1167# if _M_ARM >= 6 || defined(_M_ARM64)
1168# pragma intrinsic (_InterlockedExchange8_acq)
1169# pragma intrinsic (_InterlockedExchange8_nf)
1170# pragma intrinsic (_InterlockedExchange8_rel)
1175 return (
AO_TS_VAL_t)(_InterlockedExchange8_nf((
char volatile *)addr,
1178# define AO_HAVE_test_and_set
1183 return (
AO_TS_VAL_t)(_InterlockedExchange8_acq((
char volatile *)addr,
1186# define AO_HAVE_test_and_set_acquire
1191 return (
AO_TS_VAL_t)(_InterlockedExchange8_rel((
char volatile *)addr,
1194# define AO_HAVE_test_and_set_release
AO_INLINE AO_TS_VAL_t AO_test_and_set_full(volatile AO_TS_t *addr)
AO_INLINE unsigned int AO_int_fetch_and_add_full(volatile unsigned int *p, unsigned int incr)
AO_INLINE AO_t AO_fetch_and_sub1_full(volatile AO_t *p)
AO_INLINE unsigned int AO_int_fetch_and_sub1_full(volatile unsigned int *p)
AO_INLINE AO_t AO_fetch_and_add_full(volatile AO_t *p, AO_t incr)
AO_INLINE AO_t AO_fetch_and_add1_full(volatile AO_t *p)
AO_INLINE unsigned int AO_int_fetch_and_add1_full(volatile unsigned int *p)
#define AO_INTERLOCKED_VOLATILE
#define _InterlockedCompareExchange
#define _InterlockedDecrement
#define _InterlockedIncrement
#define _InterlockedExchangeAdd
#define AO_fetch_compare_and_swap_full(addr, old, newval)
AO_INLINE void AO_and(volatile AO_t *p, AO_t value)
AO_INLINE unsigned short AO_short_fetch_and_add(volatile unsigned short *p, unsigned short incr)
AO_INLINE unsigned char AO_char_fetch_and_add(volatile unsigned char *p, unsigned char incr)
AO_INLINE AO_t AO_fetch_and_add(volatile AO_t *p, AO_t incr)
AO_INLINE AO_t AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
AO_INLINE void AO_or(volatile AO_t *p, AO_t value)
AO_INLINE AO_TS_VAL_t AO_test_and_set(volatile AO_TS_t *addr)
AO_INLINE void AO_xor(volatile AO_t *p, AO_t value)
AO_INLINE AO_t AO_fetch_and_sub1(volatile AO_t *p)
AO_INLINE AO_t AO_fetch_and_add1(volatile AO_t *p)
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_acquire(volatile unsigned short *addr, unsigned short old, unsigned short new_val)
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_acquire(volatile unsigned char *addr, unsigned char old, unsigned char new_val)
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_acquire(volatile unsigned int *addr, unsigned int old, unsigned int new_val)
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_release(volatile unsigned int *addr, unsigned int old, unsigned int new_val)
AO_INLINE AO_t AO_fetch_and_add1_release(volatile AO_t *addr)
AO_INLINE unsigned int AO_int_fetch_and_sub1_release(volatile unsigned int *addr)
AO_INLINE unsigned int AO_int_fetch_and_add1_acquire(volatile unsigned int *addr)
AO_INLINE AO_t AO_fetch_compare_and_swap_release(volatile AO_t *addr, AO_t old, AO_t new_val)
AO_INLINE unsigned int AO_int_fetch_and_add1_release(volatile unsigned int *addr)
AO_INLINE unsigned int AO_int_fetch_and_sub1_acquire(volatile unsigned int *addr)
AO_INLINE AO_t AO_fetch_and_sub1_acquire(volatile AO_t *addr)
AO_INLINE AO_t AO_fetch_and_add1_acquire(volatile AO_t *addr)
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_release(volatile unsigned short *addr, unsigned short old, unsigned short new_val)
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_release(volatile unsigned char *addr, unsigned char old, unsigned char new_val)
AO_INLINE AO_t AO_fetch_and_sub1_release(volatile AO_t *addr)
AO_INLINE AO_t AO_fetch_compare_and_swap_acquire(volatile AO_t *addr, AO_t old, AO_t new_val)
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_full(volatile unsigned short *addr, unsigned short old_val, unsigned short new_val)
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_full(volatile unsigned char *addr, unsigned char old_val, unsigned char new_val)
AO_INLINE void AO_char_xor_release(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE AO_t AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
AO_INLINE void AO_short_xor(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_int_xor_acquire(volatile unsigned *addr, unsigned value)
AO_INLINE unsigned char AO_char_fetch_and_add_full(volatile unsignedchar *addr, unsignedchar incr)
AO_INLINE void AO_short_xor_full(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_char_and_acquire(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_char_or_acquire(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE unsigned char AO_char_fetch_and_add_release(volatile unsignedchar *addr, unsignedchar incr)
AO_INLINE void AO_int_and_acquire(volatile unsigned *addr, unsigned value)
AO_INLINE AO_t AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
AO_INLINE void AO_char_xor_acquire(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_char_and_full(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE unsigned short AO_short_fetch_and_add_full(volatile unsignedshort *addr, unsignedshort incr)
AO_INLINE void AO_xor_acquire(volatile AO_t *addr, AO_t value)
AO_INLINE unsigned short AO_short_fetch_and_add_release(volatile unsignedshort *addr, unsignedshort incr)
AO_INLINE void AO_char_or_full(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_or_release(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_short_and_full(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_char_xor_full(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_char_and(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_int_or(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_short_or_full(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE unsigned short AO_short_fetch_and_add_acquire(volatile unsignedshort *addr, unsignedshort incr)
AO_INLINE void AO_short_and_release(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_short_or_release(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_short_xor_acquire(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_int_or_acquire(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_int_and_full(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_short_and(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_char_or_release(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_short_or_acquire(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_char_and_release(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_or_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_int_xor_release(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_and_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_xor_release(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_char_or(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_int_xor_full(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_short_or(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_and_release(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_char_xor(volatile unsignedchar *addr, unsignedchar value)
AO_INLINE void AO_int_and(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_or_acquire(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_int_or_full(volatile unsigned *addr, unsigned value)
AO_INLINE unsigned AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr)
AO_INLINE void AO_and_acquire(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_xor_full(volatile AO_t *addr, AO_t value)
AO_INLINE void AO_short_xor_release(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE unsigned AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
AO_INLINE void AO_short_and_acquire(volatile unsignedshort *addr, unsignedshort value)
AO_INLINE void AO_int_or_release(volatile unsigned *addr, unsigned value)
AO_INLINE unsigned char AO_char_fetch_and_add_acquire(volatile unsignedchar *addr, unsignedchar incr)
AO_INLINE unsigned AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr)
AO_INLINE void AO_int_and_release(volatile unsigned *addr, unsigned value)
AO_INLINE void AO_int_xor(volatile unsigned *addr, unsigned value)
AO_INLINE AO_TS_VAL_t AO_test_and_set_acquire(volatile AO_TS_t *addr)
AO_INLINE AO_TS_VAL_t AO_test_and_set_release(volatile AO_TS_t *addr)
AO_INLINE unsigned AO_int_fetch_compare_and_swap_full(volatile unsigned *addr, unsigned old_val, unsigned new_val)