STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
xatomic0.h
Go to the documentation of this file.
1 /* xatomic0.h internal header */
2 #pragma once
3 #ifndef _XATOMIC0_H
4 #define _XATOMIC0_H
5 #ifndef RC_INVOKED
6 #include <yvals.h>
7 
8  #pragma pack(push,_CRT_PACKING)
9  #pragma warning(push,3)
10  #pragma push_macro("new")
11  #undef new
12 
14  /* ENUM memory_order */
15 typedef enum memory_order {
22  } memory_order;
23 
26 
27  /* SET SIZES AND FLAGS FOR COMPILER AND TARGET ARCHITECTURE */
28  /* Note: the xxx_SIZE macros are used to generate function names,
29  so they must expand to the digits representing
30  the number of bytes in the type; they cannot be expressions
31  that give the number of bytes. */
32 
33  #define _WCHAR_T_SIZE 2
34  #define _SHORT_SIZE 2
35  #define _INT_SIZE 4
36  #define _LONG_SIZE 4
37  #define _LONGLONG_SIZE 8
38 
39  #if defined(_WIN64)
40  #define _ADDR_SIZE 8
41  #else /* defined(_WIN64) */
42  #define _ADDR_SIZE 4
43  #endif /* defined(_WIN64) */
44 
45  /* TYPEDEF _Atomic_flag_t */
46 
47 typedef long _Atomic_flag_t;
48 
49  #define _ATOMIC_MAXBYTES_LOCK_FREE 8
50 
51  /* ATOMIC REFERENCE COUNTING */
53 
54 inline _Atomic_integral_t
56  { // get counter
57  return (_Counter);
58  }
59 
62  { // non-atomically initialize counter
63  _Counter = _Value;
64  }
65 
66  #ifndef _USE_INTERLOCKED_REFCOUNTING
67  #if defined(_M_IX86) || defined(_M_X64) || defined(_M_CEE_PURE)
68  #define _USE_INTERLOCKED_REFCOUNTING 1
69  #else /* defined(_M_IX86) || defined(_M_X64) || defined(_M_CEE_PURE) */
70  #define _USE_INTERLOCKED_REFCOUNTING 0
71  #endif /* defined(_M_IX86) || defined(_M_X64) || defined(_M_CEE_PURE) */
72  #endif /* _USE_INTERLOCKED_REFCOUNTING */
73 
74  /* SPIN LOCKS */
80  #pragma pop_macro("new")
81  #pragma warning(pop)
82  #pragma pack(pop)
83 #endif /* RC_INVOKED */
84 #endif /* _XATOMIC0_H */
85 
86 /*
87  * Copyright (c) by P.J. Plauger. All rights reserved.
88  * Consult your license regarding permissions and restrictions.
89 V6.50:0009 */
#define _END_EXTERN_C
Definition: yvals.h:575
#define _STD_BEGIN
Definition: yvals.h:564
_CRTIMP2_PURE void __cdecl _Unlock_shared_ptr_spin_lock()
unsigned long _Uint32t
Definition: yvals.h:811
void _Init_atomic_counter(_Atomic_counter_t &_Counter, _Atomic_integral_t _Value)
Definition: xatomic0.h:60
_EXTERN_C _CRTIMP2_PURE void __cdecl _Lock_shared_ptr_spin_lock()
long _Atomic_flag_t
Definition: xatomic0.h:47
_Uint32t _Uint4_t
Definition: xatomic0.h:24
#define _EXTERN_C
Definition: yvals.h:574
_Uint4_t _Atomic_integral_t
Definition: xatomic0.h:25
_Atomic_integral_t _Get_atomic_count(const _Atomic_counter_t &_Counter)
Definition: xatomic0.h:55
memory_order
Definition: xatomic0.h:15
Definition: xatomic0.h:20
#define _STD_END
Definition: yvals.h:565
Definition: xatomic0.h:17
Definition: xatomic0.h:16
Definition: xatomic0.h:21
Definition: xatomic0.h:19
Definition: xatomic0.h:18
#define _CRTIMP2_PURE
Definition: yvals.h:494
_In_ int _Value
Definition: setjmp.h:173
_Atomic_integral_t _Atomic_counter_t
Definition: xatomic0.h:52