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