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) && _420 == _WIN32_WCE \
28  || defined(_X86_) && 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 struct
35  { /* thread identifier for Win32 */
36  void *_Hnd; /* Win32 HANDLE */
37  unsigned int _Id;
38  } _Thrd_imp_t;
39 
40 #define _Thr_val(thr) thr._Id
41 #define _Thr_set_null(thr) (thr._Id = 0)
42 #define _Thr_is_null(thr) (thr._Id == 0)
43 
44 typedef unsigned int (_STDCALL *_Thrd_callback_t)(void *);
45 typedef struct _Mtx_internal_imp_t *_Mtx_imp_t;
46 
47 typedef struct _Cnd_internal_imp_t *_Cnd_imp_t;
48 typedef int _Tss_imp_t;
49 
50 typedef char _Once_flag_imp_t;
51  #define _ONCE_FLAG_INIT_IMP 0
52 
53  /* internal */
54 _CRTIMP2_PURE void __cdecl _Thrd_abort(const char *);
56 void _Tss_destroy(void);
57 
58  #if _THREAD_CHECKX
59  #define _THREAD_QUOTX(x) #x
60  #define _THREAD_QUOT(x) _THREAD_QUOTX(x)
61  /* CAUTION -- some compilers require this all one one line: */
62  #define _THREAD_ASSERT(expr, msg) ((expr) \
63  ? (void)0 : _Thrd_abort(__FILE__ "(" _THREAD_QUOT(__LINE__) "): " msg))
64 
65  #else /* _THREAD_CHECKX */
66  #define _THREAD_ASSERT(expr, msg) ((void)0)
67  #endif /* _THREAD_CHECKX */
68 
70 
71 /* platform-specific properties */
72  #define _THREAD_EMULATE_TSS 1
73 
74  #define _TSS_USE_MACROS 0
75  #define _TSS_DTOR_ITERATIONS_IMP 4
76 
77  #pragma pop_macro("new")
78  #pragma warning(pop)
79  #pragma pack(pop)
80 #endif /* RC_INVOKED */
81 #endif /* _THR_XTHRCOMMON_H */
82 
83 /*
84  * This file is derived from software bearing the following
85  * restrictions:
86  *
87  * (c) Copyright William E. Kempf 2001
88  *
89  * Permission to use, copy, modify, distribute and sell this
90  * software and its documentation for any purpose is hereby
91  * granted without fee, provided that the above copyright
92  * notice appear in all copies and that both that copyright
93  * notice and this permission notice appear in supporting
94  * documentation. William E. Kempf makes no representations
95  * about the suitability of this software for any purpose.
96  * It is provided "as is" without express or implied warranty.
97  */
98 
99 /*
100  * Copyright (c) 1992-2012 by P.J. Plauger. ALL RIGHTS RESERVED.
101  * Consult your license regarding permissions and restrictions.
102 V6.00:0009 */
#define _END_EXTERN_C
Definition: yvals.h:564
char _Once_flag_imp_t
Definition: xthrcommon.h:50
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
Definition: xthrcommon.h:34
struct _Cnd_internal_imp_t * _Cnd_imp_t
Definition: xthrcommon.h:47
#define _EXTERN_C
Definition: yvals.h:563
void _Tss_destroy(void)
unsigned int(_STDCALL * _Thrd_callback_t)(void *)
Definition: xthrcommon.h:44
struct _Mtx_internal_imp_t * _Mtx_imp_t
Definition: xthrcommon.h:45
unsigned int _Id
Definition: xthrcommon.h:37
void * _Hnd
Definition: xthrcommon.h:36
int _Tss_imp_t
Definition: xthrcommon.h:48
#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:483
_CRTIMP2_PURE void __cdecl _Thrd_abort(const char *)