STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
xthrcommon.h
Go to the documentation of this file.
1 /* xthrcommon.h -- common header for C/C++ threads libraries */
2 #pragma once
3 #ifndef _THR_XTHRCOMMON_H
4 #define _THR_XTHRCOMMON_H
5 #ifndef RC_INVOKED
6 #include <yvals.h>
7 
8  #pragma pack(push,_CRT_PACKING)
9  #pragma warning(push,_STL_WARNING_LEVEL)
10  #pragma warning(disable: _STL_DISABLED_WARNINGS)
11  #pragma push_macro("new")
12  #undef new
13 
14  #if defined(_THREAD_CHECK) || defined(_DEBUG)
15  #define _THREAD_CHECKX 1
16 
17  #else /* defined(_THREAD_CHECK) || defined(_DEBUG) */
18  #define _THREAD_CHECKX 0
19  #endif /* defined(_THREAD_CHECK) || defined(_DEBUG) */
20 
22 
23  #if defined(__EDG__) \
24  || defined(_X86_EMUL) && defined(_WIN32_WCE) && 420 == _WIN32_WCE \
25  || defined(_X86_) && defined(_WIN32_WCE) && 300 <= _WIN32_WCE
26  #define _STDCALL
27  #else /* defined(_X86_EMUL) etc. */
28  #define _STDCALL __stdcall
29  #endif /* defined(_X86_EMUL) etc. */
30 
31 typedef unsigned int _Thrd_id_t;
32 typedef struct
33  { /* thread identifier for Win32 */
34  void *_Hnd; /* Win32 HANDLE */
36  } _Thrd_imp_t;
37 
38 #define _Thr_val(thr) thr._Id
39 #define _Thr_set_null(thr) (thr._Hnd = 0, thr._Id = 0)
40 #define _Thr_is_null(thr) (thr._Id == 0)
41 
42 typedef unsigned int (_STDCALL *_Thrd_callback_t)(void *);
43 
44  /* Size and alignment for _Mtx_internal_imp_t and _Cnd_internal_imp_t */
45  #ifdef _CRT_WINDOWS
46  #ifdef _WIN64
47  #define _Mtx_internal_imp_size 32
48  #define _Mtx_internal_imp_alignment 8
49  #define _Cnd_internal_imp_size 16
50  #define _Cnd_internal_imp_alignment 8
51  #else /* _WIN64 */
52  #define _Mtx_internal_imp_size 20
53  #define _Mtx_internal_imp_alignment 4
54  #define _Cnd_internal_imp_size 8
55  #define _Cnd_internal_imp_alignment 4
56  #endif /* _WIN64 */
57  #else /* _CRT_WINDOWS */
58  #ifdef _WIN64
59  #define _Mtx_internal_imp_size 80
60  #define _Mtx_internal_imp_alignment 8
61  #define _Cnd_internal_imp_size 72
62  #define _Cnd_internal_imp_alignment 8
63  #else /* _WIN64 */
64  #define _Mtx_internal_imp_size 48
65  #define _Mtx_internal_imp_alignment 4
66  #define _Cnd_internal_imp_size 40
67  #define _Cnd_internal_imp_alignment 4
68  #endif /* _WIN64 */
69  #endif /* _CRT_WINDOWS */
70 
71 typedef struct _Mtx_internal_imp_t *_Mtx_imp_t;
72 
73 typedef struct _Cnd_internal_imp_t *_Cnd_imp_t;
74 typedef int _Tss_imp_t;
75 
76  /* internal */
77 _CRTIMP2_PURE void __cdecl _Thrd_abort(const char *);
79 void _Tss_destroy(void);
80 
81  #if _THREAD_CHECKX
82  #define _THREAD_QUOTX(x) #x
83  #define _THREAD_QUOT(x) _THREAD_QUOTX(x)
84  /* CAUTION -- some compilers require this all one one line: */
85  #define _THREAD_ASSERT(expr, msg) ((expr) \
86  ? (void)0 : _Thrd_abort(__FILE__ "(" _THREAD_QUOT(__LINE__) "): " msg))
87 
88  #else /* _THREAD_CHECKX */
89  #define _THREAD_ASSERT(expr, msg) ((void)0)
90  #endif /* _THREAD_CHECKX */
91 
93 
94 /* platform-specific properties */
95  #define _THREAD_EMULATE_TSS 1
96  #define _THR_ADDR
97  #define _THR_INDIR
98  #define _THR_NOINDIR(x) *(x)
99 
100  #define _TSS_USE_MACROS 0
101  #define _TSS_DTOR_ITERATIONS_IMP 4
102 
103  #pragma pop_macro("new")
104  #pragma warning(pop)
105  #pragma pack(pop)
106 #endif /* RC_INVOKED */
107 #endif /* _THR_XTHRCOMMON_H */
108 
109 /*
110  * This file is derived from software bearing the following
111  * restrictions:
112  *
113  * (c) Copyright William E. Kempf 2001
114  *
115  * Permission to use, copy, modify, distribute and sell this
116  * software and its documentation for any purpose is hereby
117  * granted without fee, provided that the above copyright
118  * notice appear in all copies and that both that copyright
119  * notice and this permission notice appear in supporting
120  * documentation. William E. Kempf makes no representations
121  * about the suitability of this software for any purpose.
122  * It is provided "as is" without express or implied warranty.
123  */
124 
125 /*
126  * Copyright (c) by P.J. Plauger. All rights reserved.
127  * Consult your license regarding permissions and restrictions.
128 V6.50:0009 */
#define _END_EXTERN_C
Definition: yvals.h:573
Definition: xthrcommon.h:32
_Thrd_id_t _Id
Definition: xthrcommon.h:35
struct _Cnd_internal_imp_t * _Cnd_imp_t
Definition: xthrcommon.h:73
#define _EXTERN_C
Definition: yvals.h:572
void _Tss_destroy(void)
unsigned int(_STDCALL * _Thrd_callback_t)(void *)
Definition: xthrcommon.h:42
struct _Mtx_internal_imp_t * _Mtx_imp_t
Definition: xthrcommon.h:71
unsigned int _Thrd_id_t
Definition: xthrcommon.h:31
char int *typedef int(__CRTDECL *_CRT_REPORT_HOOKW)(int
Definition: crtdbg.h:45
void * _Hnd
Definition: xthrcommon.h:34
int _Tss_imp_t
Definition: xthrcommon.h:74
#define _STDCALL
Definition: xthrcommon.h:28
_CRTIMP2_PURE int __cdecl _Thrd_start(_Thrd_imp_t *, _Thrd_callback_t, void *)
#define _CRTIMP2_PURE
Definition: yvals.h:527
_CRTIMP2_PURE void __cdecl _Thrd_abort(const char *)