gccxml_gem 0.9-x86-darwin-9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +75 -0
- data/bin/gccxml +0 -0
- data/bin/gccxml_cc1plus +0 -0
- data/gccxml.rb +44 -0
- data/share/doc/gccxml-0.9/Copyright.txt +55 -0
- data/share/doc/gccxml-0.9/gccxml.html +168 -0
- data/share/doc/gccxml-0.9/gccxml.txt +293 -0
- data/share/gccxml-0.9/GCC/2.95/algorithm +76 -0
- data/share/gccxml-0.9/GCC/2.95/bitset +17 -0
- data/share/gccxml-0.9/GCC/2.95/cctype +24 -0
- data/share/gccxml-0.9/GCC/2.95/clocale +14 -0
- data/share/gccxml-0.9/GCC/2.95/cmath +33 -0
- data/share/gccxml-0.9/GCC/2.95/complex +38 -0
- data/share/gccxml-0.9/GCC/2.95/csetjmp +13 -0
- data/share/gccxml-0.9/GCC/2.95/csignal +14 -0
- data/share/gccxml-0.9/GCC/2.95/cstdarg +12 -0
- data/share/gccxml-0.9/GCC/2.95/cstddef +13 -0
- data/share/gccxml-0.9/GCC/2.95/cstdio +55 -0
- data/share/gccxml-0.9/GCC/2.95/cstdlib +66 -0
- data/share/gccxml-0.9/GCC/2.95/cstring +34 -0
- data/share/gccxml-0.9/GCC/2.95/ctime +24 -0
- data/share/gccxml-0.9/GCC/2.95/cwchar +65 -0
- data/share/gccxml-0.9/GCC/2.95/cwctype +31 -0
- data/share/gccxml-0.9/GCC/2.95/deque +19 -0
- data/share/gccxml-0.9/GCC/2.95/exception +20 -0
- data/share/gccxml-0.9/GCC/2.95/fstream +23 -0
- data/share/gccxml-0.9/GCC/2.95/functional +64 -0
- data/share/gccxml-0.9/GCC/2.95/gccxml_bitset +1066 -0
- data/share/gccxml-0.9/GCC/2.95/iomanip +20 -0
- data/share/gccxml-0.9/GCC/2.95/iosfwd +20 -0
- data/share/gccxml-0.9/GCC/2.95/iostream +27 -0
- data/share/gccxml-0.9/GCC/2.95/iterator +39 -0
- data/share/gccxml-0.9/GCC/2.95/list +19 -0
- data/share/gccxml-0.9/GCC/2.95/map +20 -0
- data/share/gccxml-0.9/GCC/2.95/memory +21 -0
- data/share/gccxml-0.9/GCC/2.95/new +13 -0
- data/share/gccxml-0.9/GCC/2.95/numeric +15 -0
- data/share/gccxml-0.9/GCC/2.95/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/2.95/queue +20 -0
- data/share/gccxml-0.9/GCC/2.95/set +20 -0
- data/share/gccxml-0.9/GCC/2.95/sstream +24 -0
- data/share/gccxml-0.9/GCC/2.95/stack +19 -0
- data/share/gccxml-0.9/GCC/2.95/std/bastring.cc +524 -0
- data/share/gccxml-0.9/GCC/2.95/std/complext.h +397 -0
- data/share/gccxml-0.9/GCC/2.95/std/dcomplex.h +92 -0
- data/share/gccxml-0.9/GCC/2.95/std/fcomplex.h +88 -0
- data/share/gccxml-0.9/GCC/2.95/std/gslice_array.h +170 -0
- data/share/gccxml-0.9/GCC/2.95/std/indirect_array.h +157 -0
- data/share/gccxml-0.9/GCC/2.95/std/ldcomplex.h +96 -0
- data/share/gccxml-0.9/GCC/2.95/std/mask_array.h +154 -0
- data/share/gccxml-0.9/GCC/2.95/std/slice_array.h +156 -0
- data/share/gccxml-0.9/GCC/2.95/std/std_valarray.h +728 -0
- data/share/gccxml-0.9/GCC/2.95/std/straits.h +162 -0
- data/share/gccxml-0.9/GCC/2.95/std/valarray_meta.h +1035 -0
- data/share/gccxml-0.9/GCC/2.95/stdexcept +17 -0
- data/share/gccxml-0.9/GCC/2.95/stl_alloc.h +1057 -0
- data/share/gccxml-0.9/GCC/2.95/stl_bvector.h +836 -0
- data/share/gccxml-0.9/GCC/2.95/stl_deque.h +1699 -0
- data/share/gccxml-0.9/GCC/2.95/stl_list.h +843 -0
- data/share/gccxml-0.9/GCC/2.95/stl_tree.h +1331 -0
- data/share/gccxml-0.9/GCC/2.95/stl_vector.h +828 -0
- data/share/gccxml-0.9/GCC/2.95/string +26 -0
- data/share/gccxml-0.9/GCC/2.95/strstream +23 -0
- data/share/gccxml-0.9/GCC/2.95/typeinfo +11 -0
- data/share/gccxml-0.9/GCC/2.95/utility +25 -0
- data/share/gccxml-0.9/GCC/2.95/valarray +52 -0
- data/share/gccxml-0.9/GCC/2.95/vector +19 -0
- data/share/gccxml-0.9/GCC/2.96/sstream +305 -0
- data/share/gccxml-0.9/GCC/3.0/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.1/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.2/bits/fstream.tcc +500 -0
- data/share/gccxml-0.9/GCC/3.2/bits/istream.tcc +1207 -0
- data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.h +1810 -0
- data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.tcc +2397 -0
- data/share/gccxml-0.9/GCC/3.2/bits/messages_members.h +108 -0
- data/share/gccxml-0.9/GCC/3.2/bits/ostream.tcc +713 -0
- data/share/gccxml-0.9/GCC/3.2/bits/sstream.tcc +241 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_deque.h +1682 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_list.h +989 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_tree.h +1462 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_vector.h +1085 -0
- data/share/gccxml-0.9/GCC/3.2/bits/valarray_meta.h +1063 -0
- data/share/gccxml-0.9/GCC/3.2/fstream +579 -0
- data/share/gccxml-0.9/GCC/3.2/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.2/sstream +384 -0
- data/share/gccxml-0.9/GCC/3.3/bits/fstream.tcc +530 -0
- data/share/gccxml-0.9/GCC/3.3/bits/list.tcc +378 -0
- data/share/gccxml-0.9/GCC/3.3/bits/locale_facets.h +2050 -0
- data/share/gccxml-0.9/GCC/3.3/bits/messages_members.h +108 -0
- data/share/gccxml-0.9/GCC/3.3/bits/sstream.tcc +243 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_deque.h +1603 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_list.h +1167 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_tree.h +1462 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_vector.h +992 -0
- data/share/gccxml-0.9/GCC/3.3/bits/valarray_meta.h +1135 -0
- data/share/gccxml-0.9/GCC/3.3/fstream +842 -0
- data/share/gccxml-0.9/GCC/3.3/gccxml_builtins.h +22 -0
- data/share/gccxml-0.9/GCC/3.3/sstream +638 -0
- data/share/gccxml-0.9/GCC/3.4/gccxml_builtins.h +91 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_builtins.h +128 -0
- data/share/gccxml-0.9/GCC/4.1/bits/gthr-default.h +618 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/find_flags +105 -0
- data/share/gccxml-0.9/Intel/find_flags +56 -0
- data/share/gccxml-0.9/Intel/pthread.h +16 -0
- data/share/gccxml-0.9/MIPSpro/7.3/exception +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/gccxml_mpro_internals.h +21 -0
- data/share/gccxml-0.9/MIPSpro/7.3/iomanip +161 -0
- data/share/gccxml-0.9/MIPSpro/7.3/ostream +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stddef.h +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_config.h +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_locale.h +17 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_monetary.h +14 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_numeric_facets.h +13 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_threads.h +11 -0
- data/share/gccxml-0.9/MIPSpro/7.3/string +18 -0
- data/share/gccxml-0.9/MIPSpro/find_flags +137 -0
- data/share/gccxml-0.9/Sun/5.8/adaptation.patch +168 -0
- data/share/gccxml-0.9/Sun/README +8 -0
- data/share/gccxml-0.9/Sun/adapt_headers.sh +24 -0
- data/share/gccxml-0.9/Sun/find_flags +69 -0
- data/share/gccxml-0.9/gccxml_config +2 -0
- data/share/gccxml-0.9/gccxml_find_flags +93 -0
- data/share/man/man1/gccxml.1 +246 -0
- metadata +204 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
#define __builtin_apply(x,y,z) ((void*)0)
|
2
|
+
#define __builtin_nan(x) (0.0)
|
3
|
+
#define __builtin_nanf(x) (0.0f)
|
4
|
+
#define __builtin_nanl(x) (0.0l)
|
5
|
+
#define __builtin_huge_val(x) (0.0)
|
6
|
+
#define __builtin_huge_valf(x) (0.0f)
|
7
|
+
#define __builtin_huge_vall(x) (0.0l)
|
8
|
+
#define __builtin_apply_args(x) ((void*)0)
|
9
|
+
#define __builtin_types_compatible_p(x,y) 0
|
10
|
+
#define __builtin_choose_expr(x,y,z) int
|
11
|
+
#define __builtin_constant_p(x) 0
|
12
|
+
void __builtin_return (void *RESULT);
|
13
|
+
void * __builtin_return_address (unsigned int LEVEL);
|
14
|
+
void * __builtin_frame_address (unsigned int LEVEL);
|
15
|
+
long __builtin_expect (long EXP, long C);
|
16
|
+
void __builtin_prefetch (const void *ADDR, ...);
|
17
|
+
double __builtin_inf (void);
|
18
|
+
float __builtin_inff (void);
|
19
|
+
long double __builtin_infl (void);
|
20
|
+
double __builtin_nans (const char *str);
|
21
|
+
float __builtin_nansf (const char *str);
|
22
|
+
long double __builtin_nansl (const char *str);
|
23
|
+
double __builtin_acos(double);
|
24
|
+
float __builtin_acosf(float);
|
25
|
+
long double __builtin_acosl(long double);
|
26
|
+
double __builtin_asin(double);
|
27
|
+
float __builtin_asinf(float);
|
28
|
+
long double __builtin_asinl(long double);
|
29
|
+
double __builtin_atan(double);
|
30
|
+
double __builtin_atan2(double, double);
|
31
|
+
float __builtin_atan2f(float, float);
|
32
|
+
long double __builtin_atan2l(long double, long double);
|
33
|
+
float __builtin_atanf(float);
|
34
|
+
long double __builtin_atanl(long double);
|
35
|
+
double __builtin_ceil(double);
|
36
|
+
float __builtin_ceilf(float);
|
37
|
+
long double __builtin_ceill(long double);
|
38
|
+
double __builtin_cos(double);
|
39
|
+
float __builtin_cosf(float);
|
40
|
+
double __builtin_cosh(double);
|
41
|
+
float __builtin_coshf(float);
|
42
|
+
long double __builtin_coshl(long double);
|
43
|
+
long double __builtin_cosl(long double);
|
44
|
+
double __builtin_exp(double);
|
45
|
+
float __builtin_expf(float);
|
46
|
+
long double __builtin_expl(long double);
|
47
|
+
double __builtin_fabs(double);
|
48
|
+
float __builtin_fabsf(float);
|
49
|
+
long double __builtin_fabsl(long double);
|
50
|
+
double __builtin_floor(double);
|
51
|
+
float __builtin_floorf(float);
|
52
|
+
long double __builtin_floorl(long double);
|
53
|
+
float __builtin_fmodf(float, float);
|
54
|
+
long double __builtin_fmodl(long double, long double);
|
55
|
+
double __builtin_frexp(double, int*);
|
56
|
+
float __builtin_frexpf(float, int*);
|
57
|
+
long double __builtin_frexpl(long double, int*);
|
58
|
+
double __builtin_ldexp(double, int);
|
59
|
+
float __builtin_ldexpf(float, int);
|
60
|
+
long double __builtin_ldexpl(long double, int);
|
61
|
+
double __builtin_log(double);
|
62
|
+
double __builtin_log10(double);
|
63
|
+
float __builtin_log10f(float);
|
64
|
+
long double __builtin_log10l(long double);
|
65
|
+
float __builtin_logf(float);
|
66
|
+
long double __builtin_logl(long double);
|
67
|
+
float __builtin_modff(float, float*);
|
68
|
+
long double __builtin_modfl(long double, long double*);
|
69
|
+
float __builtin_powf(float, float);
|
70
|
+
long double __builtin_powl(long double, long double);
|
71
|
+
double __builtin_sin(double);
|
72
|
+
float __builtin_sinf(float);
|
73
|
+
double __builtin_sinh(double);
|
74
|
+
float __builtin_sinhf(float);
|
75
|
+
long double __builtin_sinhl(long double);
|
76
|
+
long double __builtin_sinl(long double);
|
77
|
+
double __builtin_sqrt(double);
|
78
|
+
float __builtin_sqrtf(float);
|
79
|
+
long double __builtin_sqrtl(long double);
|
80
|
+
double __builtin_tan(double);
|
81
|
+
float __builtin_tanf(float);
|
82
|
+
double __builtin_tanh(double);
|
83
|
+
float __builtin_tanhf(float);
|
84
|
+
long double __builtin_tanhl(long double);
|
85
|
+
long double __builtin_tanl(long double);
|
86
|
+
int __builtin_ctz(int);
|
87
|
+
int __builtin_ctzl(long);
|
88
|
+
int __builtin_ctzll(long long);
|
89
|
+
int __builtin_popcount(int);
|
90
|
+
int __builtin_popcountl(long);
|
91
|
+
int __builtin_popcountll(long long);
|
@@ -0,0 +1,128 @@
|
|
1
|
+
#define __builtin_apply(x,y,z) ((void*)0)
|
2
|
+
#define __builtin_nan(x) (0.0)
|
3
|
+
#define __builtin_nanf(x) (0.0f)
|
4
|
+
#define __builtin_nanl(x) (0.0l)
|
5
|
+
#define __builtin_huge_val(x) (0.0)
|
6
|
+
#define __builtin_huge_valf(x) (0.0f)
|
7
|
+
#define __builtin_huge_vall(x) (0.0l)
|
8
|
+
#define __builtin_apply_args(x) ((void*)0)
|
9
|
+
#define __builtin_types_compatible_p(x,y) 0
|
10
|
+
#define __builtin_choose_expr(x,y,z) int
|
11
|
+
#define __builtin_constant_p(x) 0
|
12
|
+
#define __builtin_offsetof(x,y) 0
|
13
|
+
void __builtin_return (void *RESULT);
|
14
|
+
void * __builtin_return_address (unsigned int LEVEL);
|
15
|
+
void * __builtin_frame_address (unsigned int LEVEL);
|
16
|
+
long __builtin_expect (long EXP, long C);
|
17
|
+
void __builtin_prefetch (const void *ADDR, ...);
|
18
|
+
double __builtin_inf (void);
|
19
|
+
float __builtin_inff (void);
|
20
|
+
long double __builtin_infl (void);
|
21
|
+
double __builtin_nans (const char *str);
|
22
|
+
float __builtin_nansf (const char *str);
|
23
|
+
long double __builtin_nansl (const char *str);
|
24
|
+
double __builtin_acos(double);
|
25
|
+
float __builtin_acosf(float);
|
26
|
+
long double __builtin_acosl(long double);
|
27
|
+
double __builtin_asin(double);
|
28
|
+
float __builtin_asinf(float);
|
29
|
+
long double __builtin_asinl(long double);
|
30
|
+
double __builtin_atan(double);
|
31
|
+
double __builtin_atan2(double, double);
|
32
|
+
float __builtin_atan2f(float, float);
|
33
|
+
long double __builtin_atan2l(long double, long double);
|
34
|
+
float __builtin_atanf(float);
|
35
|
+
long double __builtin_atanl(long double);
|
36
|
+
double __builtin_ceil(double);
|
37
|
+
float __builtin_ceilf(float);
|
38
|
+
long double __builtin_ceill(long double);
|
39
|
+
double __builtin_cos(double);
|
40
|
+
float __builtin_cosf(float);
|
41
|
+
double __builtin_cosh(double);
|
42
|
+
float __builtin_coshf(float);
|
43
|
+
long double __builtin_coshl(long double);
|
44
|
+
long double __builtin_cosl(long double);
|
45
|
+
double __builtin_exp(double);
|
46
|
+
float __builtin_expf(float);
|
47
|
+
long double __builtin_expl(long double);
|
48
|
+
double __builtin_fabs(double);
|
49
|
+
float __builtin_fabsf(float);
|
50
|
+
long double __builtin_fabsl(long double);
|
51
|
+
double __builtin_floor(double);
|
52
|
+
float __builtin_floorf(float);
|
53
|
+
long double __builtin_floorl(long double);
|
54
|
+
float __builtin_fmodf(float, float);
|
55
|
+
long double __builtin_fmodl(long double, long double);
|
56
|
+
double __builtin_frexp(double, int*);
|
57
|
+
float __builtin_frexpf(float, int*);
|
58
|
+
long double __builtin_frexpl(long double, int*);
|
59
|
+
double __builtin_ldexp(double, int);
|
60
|
+
float __builtin_ldexpf(float, int);
|
61
|
+
long double __builtin_ldexpl(long double, int);
|
62
|
+
double __builtin_log(double);
|
63
|
+
double __builtin_log10(double);
|
64
|
+
float __builtin_log10f(float);
|
65
|
+
long double __builtin_log10l(long double);
|
66
|
+
float __builtin_logf(float);
|
67
|
+
long double __builtin_logl(long double);
|
68
|
+
float __builtin_modff(float, float*);
|
69
|
+
long double __builtin_modfl(long double, long double*);
|
70
|
+
float __builtin_powf(float, float);
|
71
|
+
long double __builtin_powl(long double, long double);
|
72
|
+
double __builtin_powi(double, int);
|
73
|
+
float __builtin_powif(float, int);
|
74
|
+
long double __builtin_powil(long double, int);
|
75
|
+
double __builtin_sin(double);
|
76
|
+
float __builtin_sinf(float);
|
77
|
+
double __builtin_sinh(double);
|
78
|
+
float __builtin_sinhf(float);
|
79
|
+
long double __builtin_sinhl(long double);
|
80
|
+
long double __builtin_sinl(long double);
|
81
|
+
double __builtin_sqrt(double);
|
82
|
+
float __builtin_sqrtf(float);
|
83
|
+
long double __builtin_sqrtl(long double);
|
84
|
+
double __builtin_tan(double);
|
85
|
+
float __builtin_tanf(float);
|
86
|
+
double __builtin_tanh(double);
|
87
|
+
float __builtin_tanhf(float);
|
88
|
+
long double __builtin_tanhl(long double);
|
89
|
+
long double __builtin_tanl(long double);
|
90
|
+
float __builtin_cabsf(float __complex__);
|
91
|
+
double __builtin_cabs(double __complex__);
|
92
|
+
long double __builtin_cabsl(long double __complex__);
|
93
|
+
float __builtin_cargf(float __complex__);
|
94
|
+
double __builtin_carg(double __complex__);
|
95
|
+
long double __builtin_cargl(long double __complex__);
|
96
|
+
int __builtin_ctz(int);
|
97
|
+
int __builtin_ctzl(long);
|
98
|
+
int __builtin_ctzll(long long);
|
99
|
+
int __builtin_popcount(int);
|
100
|
+
int __builtin_popcountl(long);
|
101
|
+
int __builtin_popcountll(long long);
|
102
|
+
float __complex__ __builtin_ccosf(float __complex__);
|
103
|
+
double __complex__ __builtin_ccos(double __complex__);
|
104
|
+
long double __complex__ __builtin_ccosl(long double __complex__);
|
105
|
+
float __complex__ __builtin_ccoshf(float __complex__);
|
106
|
+
double __complex__ __builtin_ccosh(double __complex__);
|
107
|
+
long double __complex__ __builtin_ccoshl(long double __complex__);
|
108
|
+
float __complex__ __builtin_cexpf(float __complex__);
|
109
|
+
double __complex__ __builtin_cexp(double __complex__);
|
110
|
+
long double __complex__ __builtin_cexpl(long double __complex__);
|
111
|
+
float __complex__ __builtin_csinf(float __complex__);
|
112
|
+
double __complex__ __builtin_csin(double __complex__);
|
113
|
+
long double __complex__ __builtin_csinl(long double __complex__);
|
114
|
+
float __complex__ __builtin_csinhf(float __complex__);
|
115
|
+
double __complex__ __builtin_csinh(double __complex__);
|
116
|
+
long double __complex__ __builtin_csinhl(long double __complex__);
|
117
|
+
float __complex__ __builtin_csqrtf(float __complex__);
|
118
|
+
double __complex__ __builtin_csqrt(double __complex__);
|
119
|
+
long double __complex__ __builtin_csqrtl(long double __complex__);
|
120
|
+
float __complex__ __builtin_ctanf(float __complex__);
|
121
|
+
double __complex__ __builtin_ctan(double __complex__);
|
122
|
+
long double __complex__ __builtin_ctanl(long double __complex__);
|
123
|
+
float __complex__ __builtin_ctanhf(float __complex__);
|
124
|
+
double __complex__ __builtin_ctanh(double __complex__);
|
125
|
+
long double __complex__ __builtin_ctanhl(long double __complex__);
|
126
|
+
float __complex__ __builtin_cpowf(float __complex__, float __complex__);
|
127
|
+
double __complex__ __builtin_cpow(double __complex__, double __complex__);
|
128
|
+
long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__);
|
@@ -0,0 +1,618 @@
|
|
1
|
+
/* Threads compatibility routines for libgcc2 and libobjc. */
|
2
|
+
/* Compile this one with gcc. */
|
3
|
+
/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
4
|
+
Free Software Foundation, Inc.
|
5
|
+
|
6
|
+
This file is part of GCC.
|
7
|
+
|
8
|
+
GCC is free software; you can redistribute it and/or modify it under
|
9
|
+
the terms of the GNU General Public License as published by the Free
|
10
|
+
Software Foundation; either version 2, or (at your option) any later
|
11
|
+
version.
|
12
|
+
|
13
|
+
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
14
|
+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
16
|
+
for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with GCC; see the file COPYING. If not, write to the Free
|
20
|
+
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
21
|
+
02110-1301, USA. */
|
22
|
+
|
23
|
+
/* As a special exception, if you link this library with other files,
|
24
|
+
some of which are compiled with GCC, to produce an executable,
|
25
|
+
this library does not by itself cause the resulting executable
|
26
|
+
to be covered by the GNU General Public License.
|
27
|
+
This exception does not however invalidate any other reasons why
|
28
|
+
the executable file might be covered by the GNU General Public License. */
|
29
|
+
|
30
|
+
#ifndef _GLIBCXX_GCC_GTHR_POSIX_H
|
31
|
+
#define _GLIBCXX_GCC_GTHR_POSIX_H
|
32
|
+
|
33
|
+
/* POSIX threads specific definitions.
|
34
|
+
Easy, since the interface is just one-to-one mapping. */
|
35
|
+
|
36
|
+
#define __GTHREADS 1
|
37
|
+
|
38
|
+
/* Some implementations of <pthread.h> require this to be defined. */
|
39
|
+
#if !defined(_REENTRANT) && defined(__osf__)
|
40
|
+
#define _REENTRANT 1
|
41
|
+
#endif
|
42
|
+
|
43
|
+
#include <pthread.h>
|
44
|
+
#include <unistd.h>
|
45
|
+
|
46
|
+
typedef pthread_key_t __gthread_key_t;
|
47
|
+
typedef pthread_once_t __gthread_once_t;
|
48
|
+
typedef pthread_mutex_t __gthread_mutex_t;
|
49
|
+
typedef pthread_mutex_t __gthread_recursive_mutex_t;
|
50
|
+
|
51
|
+
#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
|
52
|
+
#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
|
53
|
+
#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
|
54
|
+
#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
|
55
|
+
#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
|
56
|
+
#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
|
57
|
+
#else
|
58
|
+
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
|
59
|
+
#endif
|
60
|
+
|
61
|
+
#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK && 0
|
62
|
+
# ifndef __gthrw_pragma
|
63
|
+
# define __gthrw_pragma(pragma)
|
64
|
+
# endif
|
65
|
+
# define __gthrw2(name,name2,type) \
|
66
|
+
extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
|
67
|
+
__gthrw_pragma(weak type)
|
68
|
+
# define __gthrw_(name) __gthrw_ ## name
|
69
|
+
#else
|
70
|
+
# define __gthrw2(name,name2,type)
|
71
|
+
# define __gthrw_(name) name
|
72
|
+
#endif
|
73
|
+
|
74
|
+
/* Typically, __gthrw_foo is a weak reference to symbol foo. */
|
75
|
+
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
|
76
|
+
|
77
|
+
/* On Tru64, /usr/include/pthread.h uses #pragma extern_prefix "__" to
|
78
|
+
map a subset of the POSIX pthread API to mangled versions of their
|
79
|
+
names. */
|
80
|
+
#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
|
81
|
+
#define __gthrw3(name) __gthrw2(__gthrw_ ## name, __ ## name, name)
|
82
|
+
__gthrw3(pthread_once)
|
83
|
+
__gthrw3(pthread_getspecific)
|
84
|
+
__gthrw3(pthread_setspecific)
|
85
|
+
__gthrw3(pthread_create)
|
86
|
+
__gthrw3(pthread_cancel)
|
87
|
+
__gthrw3(pthread_mutex_lock)
|
88
|
+
__gthrw3(pthread_mutex_trylock)
|
89
|
+
__gthrw3(pthread_mutex_unlock)
|
90
|
+
__gthrw3(pthread_mutex_init)
|
91
|
+
#else
|
92
|
+
__gthrw(pthread_once)
|
93
|
+
__gthrw(pthread_getspecific)
|
94
|
+
__gthrw(pthread_setspecific)
|
95
|
+
__gthrw(pthread_create)
|
96
|
+
__gthrw(pthread_cancel)
|
97
|
+
__gthrw(pthread_mutex_lock)
|
98
|
+
__gthrw(pthread_mutex_trylock)
|
99
|
+
__gthrw(pthread_mutex_unlock)
|
100
|
+
__gthrw(pthread_mutex_init)
|
101
|
+
#endif
|
102
|
+
|
103
|
+
__gthrw(pthread_key_create)
|
104
|
+
__gthrw(pthread_key_delete)
|
105
|
+
__gthrw(pthread_mutexattr_init)
|
106
|
+
__gthrw(pthread_mutexattr_settype)
|
107
|
+
__gthrw(pthread_mutexattr_destroy)
|
108
|
+
|
109
|
+
|
110
|
+
#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
|
111
|
+
/* Objective-C. */
|
112
|
+
#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
|
113
|
+
__gthrw3(pthread_cond_broadcast)
|
114
|
+
__gthrw3(pthread_cond_destroy)
|
115
|
+
__gthrw3(pthread_cond_init)
|
116
|
+
__gthrw3(pthread_cond_signal)
|
117
|
+
__gthrw3(pthread_cond_wait)
|
118
|
+
__gthrw3(pthread_exit)
|
119
|
+
__gthrw3(pthread_mutex_destroy)
|
120
|
+
__gthrw3(pthread_self)
|
121
|
+
#else
|
122
|
+
__gthrw(pthread_cond_broadcast)
|
123
|
+
__gthrw(pthread_cond_destroy)
|
124
|
+
__gthrw(pthread_cond_init)
|
125
|
+
__gthrw(pthread_cond_signal)
|
126
|
+
__gthrw(pthread_cond_wait)
|
127
|
+
__gthrw(pthread_exit)
|
128
|
+
__gthrw(pthread_mutex_destroy)
|
129
|
+
__gthrw(pthread_self)
|
130
|
+
#endif /* __osf__ && _PTHREAD_USE_MANGLED_NAMES_ */
|
131
|
+
#ifdef _POSIX_PRIORITY_SCHEDULING
|
132
|
+
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
|
133
|
+
__gthrw(sched_get_priority_max)
|
134
|
+
__gthrw(sched_get_priority_min)
|
135
|
+
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
|
136
|
+
#endif /* _POSIX_PRIORITY_SCHEDULING */
|
137
|
+
__gthrw(sched_yield)
|
138
|
+
__gthrw(pthread_attr_destroy)
|
139
|
+
__gthrw(pthread_attr_init)
|
140
|
+
__gthrw(pthread_attr_setdetachstate)
|
141
|
+
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
|
142
|
+
__gthrw(pthread_getschedparam)
|
143
|
+
__gthrw(pthread_setschedparam)
|
144
|
+
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
|
145
|
+
#endif /* _LIBOBJC || _LIBOBJC_WEAK */
|
146
|
+
|
147
|
+
#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK
|
148
|
+
|
149
|
+
static inline int
|
150
|
+
__gthread_active_p (void)
|
151
|
+
{
|
152
|
+
static void *const __gthread_active_ptr
|
153
|
+
= __extension__ (void *) &__gthrw_(pthread_cancel);
|
154
|
+
return __gthread_active_ptr != 0;
|
155
|
+
}
|
156
|
+
|
157
|
+
#else /* not __GXX_WEAK__ */
|
158
|
+
|
159
|
+
static inline int
|
160
|
+
__gthread_active_p (void)
|
161
|
+
{
|
162
|
+
return 1;
|
163
|
+
}
|
164
|
+
|
165
|
+
#endif /* __GXX_WEAK__ */
|
166
|
+
|
167
|
+
#ifdef _LIBOBJC
|
168
|
+
|
169
|
+
/* This is the config.h file in libobjc/ */
|
170
|
+
#include <config.h>
|
171
|
+
|
172
|
+
#ifdef HAVE_SCHED_H
|
173
|
+
# include <sched.h>
|
174
|
+
#endif
|
175
|
+
|
176
|
+
/* Key structure for maintaining thread specific storage */
|
177
|
+
static pthread_key_t _objc_thread_storage;
|
178
|
+
static pthread_attr_t _objc_thread_attribs;
|
179
|
+
|
180
|
+
/* Thread local storage for a single thread */
|
181
|
+
static void *thread_local_storage = NULL;
|
182
|
+
|
183
|
+
/* Backend initialization functions */
|
184
|
+
|
185
|
+
/* Initialize the threads subsystem. */
|
186
|
+
static inline int
|
187
|
+
__gthread_objc_init_thread_system (void)
|
188
|
+
{
|
189
|
+
if (__gthread_active_p ())
|
190
|
+
{
|
191
|
+
/* Initialize the thread storage key. */
|
192
|
+
if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0)
|
193
|
+
{
|
194
|
+
/* The normal default detach state for threads is
|
195
|
+
* PTHREAD_CREATE_JOINABLE which causes threads to not die
|
196
|
+
* when you think they should. */
|
197
|
+
if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0
|
198
|
+
&& __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs,
|
199
|
+
PTHREAD_CREATE_DETACHED) == 0)
|
200
|
+
return 0;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
return -1;
|
205
|
+
}
|
206
|
+
|
207
|
+
/* Close the threads subsystem. */
|
208
|
+
static inline int
|
209
|
+
__gthread_objc_close_thread_system (void)
|
210
|
+
{
|
211
|
+
if (__gthread_active_p ()
|
212
|
+
&& __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0
|
213
|
+
&& __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0)
|
214
|
+
return 0;
|
215
|
+
|
216
|
+
return -1;
|
217
|
+
}
|
218
|
+
|
219
|
+
/* Backend thread functions */
|
220
|
+
|
221
|
+
/* Create a new thread of execution. */
|
222
|
+
static inline objc_thread_t
|
223
|
+
__gthread_objc_thread_detach (void (*func)(void *), void *arg)
|
224
|
+
{
|
225
|
+
objc_thread_t thread_id;
|
226
|
+
pthread_t new_thread_handle;
|
227
|
+
|
228
|
+
if (!__gthread_active_p ())
|
229
|
+
return NULL;
|
230
|
+
|
231
|
+
if (!(__gthrw_(pthread_create) (&new_thread_handle, NULL, (void *) func, arg)))
|
232
|
+
thread_id = (objc_thread_t) new_thread_handle;
|
233
|
+
else
|
234
|
+
thread_id = NULL;
|
235
|
+
|
236
|
+
return thread_id;
|
237
|
+
}
|
238
|
+
|
239
|
+
/* Set the current thread's priority. */
|
240
|
+
static inline int
|
241
|
+
__gthread_objc_thread_set_priority (int priority)
|
242
|
+
{
|
243
|
+
if (!__gthread_active_p ())
|
244
|
+
return -1;
|
245
|
+
else
|
246
|
+
{
|
247
|
+
#ifdef _POSIX_PRIORITY_SCHEDULING
|
248
|
+
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
|
249
|
+
pthread_t thread_id = __gthrw_(pthread_self) ();
|
250
|
+
int policy;
|
251
|
+
struct sched_param params;
|
252
|
+
int priority_min, priority_max;
|
253
|
+
|
254
|
+
if (__gthrw_(pthread_getschedparam) (thread_id, &policy, ¶ms) == 0)
|
255
|
+
{
|
256
|
+
if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1)
|
257
|
+
return -1;
|
258
|
+
|
259
|
+
if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1)
|
260
|
+
return -1;
|
261
|
+
|
262
|
+
if (priority > priority_max)
|
263
|
+
priority = priority_max;
|
264
|
+
else if (priority < priority_min)
|
265
|
+
priority = priority_min;
|
266
|
+
params.sched_priority = priority;
|
267
|
+
|
268
|
+
/*
|
269
|
+
* The solaris 7 and several other man pages incorrectly state that
|
270
|
+
* this should be a pointer to policy but pthread.h is universally
|
271
|
+
* at odds with this.
|
272
|
+
*/
|
273
|
+
if (__gthrw_(pthread_setschedparam) (thread_id, policy, ¶ms) == 0)
|
274
|
+
return 0;
|
275
|
+
}
|
276
|
+
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
|
277
|
+
#endif /* _POSIX_PRIORITY_SCHEDULING */
|
278
|
+
return -1;
|
279
|
+
}
|
280
|
+
}
|
281
|
+
|
282
|
+
/* Return the current thread's priority. */
|
283
|
+
static inline int
|
284
|
+
__gthread_objc_thread_get_priority (void)
|
285
|
+
{
|
286
|
+
#ifdef _POSIX_PRIORITY_SCHEDULING
|
287
|
+
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
|
288
|
+
if (__gthread_active_p ())
|
289
|
+
{
|
290
|
+
int policy;
|
291
|
+
struct sched_param params;
|
292
|
+
|
293
|
+
if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, ¶ms) == 0)
|
294
|
+
return params.sched_priority;
|
295
|
+
else
|
296
|
+
return -1;
|
297
|
+
}
|
298
|
+
else
|
299
|
+
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
|
300
|
+
#endif /* _POSIX_PRIORITY_SCHEDULING */
|
301
|
+
return OBJC_THREAD_INTERACTIVE_PRIORITY;
|
302
|
+
}
|
303
|
+
|
304
|
+
/* Yield our process time to another thread. */
|
305
|
+
static inline void
|
306
|
+
__gthread_objc_thread_yield (void)
|
307
|
+
{
|
308
|
+
if (__gthread_active_p ())
|
309
|
+
__gthrw_(sched_yield) ();
|
310
|
+
}
|
311
|
+
|
312
|
+
/* Terminate the current thread. */
|
313
|
+
static inline int
|
314
|
+
__gthread_objc_thread_exit (void)
|
315
|
+
{
|
316
|
+
if (__gthread_active_p ())
|
317
|
+
/* exit the thread */
|
318
|
+
__gthrw_(pthread_exit) (&__objc_thread_exit_status);
|
319
|
+
|
320
|
+
/* Failed if we reached here */
|
321
|
+
return -1;
|
322
|
+
}
|
323
|
+
|
324
|
+
/* Returns an integer value which uniquely describes a thread. */
|
325
|
+
static inline objc_thread_t
|
326
|
+
__gthread_objc_thread_id (void)
|
327
|
+
{
|
328
|
+
if (__gthread_active_p ())
|
329
|
+
return (objc_thread_t) __gthrw_(pthread_self) ();
|
330
|
+
else
|
331
|
+
return (objc_thread_t) 1;
|
332
|
+
}
|
333
|
+
|
334
|
+
/* Sets the thread's local storage pointer. */
|
335
|
+
static inline int
|
336
|
+
__gthread_objc_thread_set_data (void *value)
|
337
|
+
{
|
338
|
+
if (__gthread_active_p ())
|
339
|
+
return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
|
340
|
+
else
|
341
|
+
{
|
342
|
+
thread_local_storage = value;
|
343
|
+
return 0;
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
/* Returns the thread's local storage pointer. */
|
348
|
+
static inline void *
|
349
|
+
__gthread_objc_thread_get_data (void)
|
350
|
+
{
|
351
|
+
if (__gthread_active_p ())
|
352
|
+
return __gthrw_(pthread_getspecific) (_objc_thread_storage);
|
353
|
+
else
|
354
|
+
return thread_local_storage;
|
355
|
+
}
|
356
|
+
|
357
|
+
/* Backend mutex functions */
|
358
|
+
|
359
|
+
/* Allocate a mutex. */
|
360
|
+
static inline int
|
361
|
+
__gthread_objc_mutex_allocate (objc_mutex_t mutex)
|
362
|
+
{
|
363
|
+
if (__gthread_active_p ())
|
364
|
+
{
|
365
|
+
mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
|
366
|
+
|
367
|
+
if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL))
|
368
|
+
{
|
369
|
+
objc_free (mutex->backend);
|
370
|
+
mutex->backend = NULL;
|
371
|
+
return -1;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
|
375
|
+
return 0;
|
376
|
+
}
|
377
|
+
|
378
|
+
/* Deallocate a mutex. */
|
379
|
+
static inline int
|
380
|
+
__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
|
381
|
+
{
|
382
|
+
if (__gthread_active_p ())
|
383
|
+
{
|
384
|
+
int count;
|
385
|
+
|
386
|
+
/*
|
387
|
+
* Posix Threads specifically require that the thread be unlocked
|
388
|
+
* for __gthrw_(pthread_mutex_destroy) to work.
|
389
|
+
*/
|
390
|
+
|
391
|
+
do
|
392
|
+
{
|
393
|
+
count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
|
394
|
+
if (count < 0)
|
395
|
+
return -1;
|
396
|
+
}
|
397
|
+
while (count);
|
398
|
+
|
399
|
+
if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
|
400
|
+
return -1;
|
401
|
+
|
402
|
+
objc_free (mutex->backend);
|
403
|
+
mutex->backend = NULL;
|
404
|
+
}
|
405
|
+
return 0;
|
406
|
+
}
|
407
|
+
|
408
|
+
/* Grab a lock on a mutex. */
|
409
|
+
static inline int
|
410
|
+
__gthread_objc_mutex_lock (objc_mutex_t mutex)
|
411
|
+
{
|
412
|
+
if (__gthread_active_p ()
|
413
|
+
&& __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0)
|
414
|
+
{
|
415
|
+
return -1;
|
416
|
+
}
|
417
|
+
|
418
|
+
return 0;
|
419
|
+
}
|
420
|
+
|
421
|
+
/* Try to grab a lock on a mutex. */
|
422
|
+
static inline int
|
423
|
+
__gthread_objc_mutex_trylock (objc_mutex_t mutex)
|
424
|
+
{
|
425
|
+
if (__gthread_active_p ()
|
426
|
+
&& __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0)
|
427
|
+
{
|
428
|
+
return -1;
|
429
|
+
}
|
430
|
+
|
431
|
+
return 0;
|
432
|
+
}
|
433
|
+
|
434
|
+
/* Unlock the mutex */
|
435
|
+
static inline int
|
436
|
+
__gthread_objc_mutex_unlock (objc_mutex_t mutex)
|
437
|
+
{
|
438
|
+
if (__gthread_active_p ()
|
439
|
+
&& __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0)
|
440
|
+
{
|
441
|
+
return -1;
|
442
|
+
}
|
443
|
+
|
444
|
+
return 0;
|
445
|
+
}
|
446
|
+
|
447
|
+
/* Backend condition mutex functions */
|
448
|
+
|
449
|
+
/* Allocate a condition. */
|
450
|
+
static inline int
|
451
|
+
__gthread_objc_condition_allocate (objc_condition_t condition)
|
452
|
+
{
|
453
|
+
if (__gthread_active_p ())
|
454
|
+
{
|
455
|
+
condition->backend = objc_malloc (sizeof (pthread_cond_t));
|
456
|
+
|
457
|
+
if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL))
|
458
|
+
{
|
459
|
+
objc_free (condition->backend);
|
460
|
+
condition->backend = NULL;
|
461
|
+
return -1;
|
462
|
+
}
|
463
|
+
}
|
464
|
+
|
465
|
+
return 0;
|
466
|
+
}
|
467
|
+
|
468
|
+
/* Deallocate a condition. */
|
469
|
+
static inline int
|
470
|
+
__gthread_objc_condition_deallocate (objc_condition_t condition)
|
471
|
+
{
|
472
|
+
if (__gthread_active_p ())
|
473
|
+
{
|
474
|
+
if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend))
|
475
|
+
return -1;
|
476
|
+
|
477
|
+
objc_free (condition->backend);
|
478
|
+
condition->backend = NULL;
|
479
|
+
}
|
480
|
+
return 0;
|
481
|
+
}
|
482
|
+
|
483
|
+
/* Wait on the condition */
|
484
|
+
static inline int
|
485
|
+
__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
|
486
|
+
{
|
487
|
+
if (__gthread_active_p ())
|
488
|
+
return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend,
|
489
|
+
(pthread_mutex_t *) mutex->backend);
|
490
|
+
else
|
491
|
+
return 0;
|
492
|
+
}
|
493
|
+
|
494
|
+
/* Wake up all threads waiting on this condition. */
|
495
|
+
static inline int
|
496
|
+
__gthread_objc_condition_broadcast (objc_condition_t condition)
|
497
|
+
{
|
498
|
+
if (__gthread_active_p ())
|
499
|
+
return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend);
|
500
|
+
else
|
501
|
+
return 0;
|
502
|
+
}
|
503
|
+
|
504
|
+
/* Wake up one thread waiting on this condition. */
|
505
|
+
static inline int
|
506
|
+
__gthread_objc_condition_signal (objc_condition_t condition)
|
507
|
+
{
|
508
|
+
if (__gthread_active_p ())
|
509
|
+
return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend);
|
510
|
+
else
|
511
|
+
return 0;
|
512
|
+
}
|
513
|
+
|
514
|
+
#else /* _LIBOBJC */
|
515
|
+
|
516
|
+
static inline int
|
517
|
+
__gthread_once (__gthread_once_t *once, void (*func) (void))
|
518
|
+
{
|
519
|
+
if (__gthread_active_p ())
|
520
|
+
return __gthrw_(pthread_once) (once, func);
|
521
|
+
else
|
522
|
+
return -1;
|
523
|
+
}
|
524
|
+
|
525
|
+
static inline int
|
526
|
+
__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
|
527
|
+
{
|
528
|
+
return __gthrw_(pthread_key_create) (key, dtor);
|
529
|
+
}
|
530
|
+
|
531
|
+
static inline int
|
532
|
+
__gthread_key_delete (__gthread_key_t key)
|
533
|
+
{
|
534
|
+
return __gthrw_(pthread_key_delete) (key);
|
535
|
+
}
|
536
|
+
|
537
|
+
static inline void *
|
538
|
+
__gthread_getspecific (__gthread_key_t key)
|
539
|
+
{
|
540
|
+
return __gthrw_(pthread_getspecific) (key);
|
541
|
+
}
|
542
|
+
|
543
|
+
static inline int
|
544
|
+
__gthread_setspecific (__gthread_key_t key, const void *ptr)
|
545
|
+
{
|
546
|
+
return __gthrw_(pthread_setspecific) (key, ptr);
|
547
|
+
}
|
548
|
+
|
549
|
+
static inline int
|
550
|
+
__gthread_mutex_lock (__gthread_mutex_t *mutex)
|
551
|
+
{
|
552
|
+
if (__gthread_active_p ())
|
553
|
+
return __gthrw_(pthread_mutex_lock) (mutex);
|
554
|
+
else
|
555
|
+
return 0;
|
556
|
+
}
|
557
|
+
|
558
|
+
static inline int
|
559
|
+
__gthread_mutex_trylock (__gthread_mutex_t *mutex)
|
560
|
+
{
|
561
|
+
if (__gthread_active_p ())
|
562
|
+
return __gthrw_(pthread_mutex_trylock) (mutex);
|
563
|
+
else
|
564
|
+
return 0;
|
565
|
+
}
|
566
|
+
|
567
|
+
static inline int
|
568
|
+
__gthread_mutex_unlock (__gthread_mutex_t *mutex)
|
569
|
+
{
|
570
|
+
if (__gthread_active_p ())
|
571
|
+
return __gthrw_(pthread_mutex_unlock) (mutex);
|
572
|
+
else
|
573
|
+
return 0;
|
574
|
+
}
|
575
|
+
|
576
|
+
#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
|
577
|
+
static inline int
|
578
|
+
__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex)
|
579
|
+
{
|
580
|
+
if (__gthread_active_p ())
|
581
|
+
{
|
582
|
+
pthread_mutexattr_t attr;
|
583
|
+
int r;
|
584
|
+
|
585
|
+
r = __gthrw_(pthread_mutexattr_init) (&attr);
|
586
|
+
if (!r)
|
587
|
+
r = __gthrw_(pthread_mutexattr_settype) (&attr, PTHREAD_MUTEX_RECURSIVE);
|
588
|
+
if (!r)
|
589
|
+
r = __gthrw_(pthread_mutex_init) (mutex, &attr);
|
590
|
+
if (!r)
|
591
|
+
r = __gthrw_(pthread_mutexattr_destroy) (&attr);
|
592
|
+
return r;
|
593
|
+
}
|
594
|
+
return 0;
|
595
|
+
}
|
596
|
+
#endif
|
597
|
+
|
598
|
+
static inline int
|
599
|
+
__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
|
600
|
+
{
|
601
|
+
return __gthread_mutex_lock (mutex);
|
602
|
+
}
|
603
|
+
|
604
|
+
static inline int
|
605
|
+
__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
|
606
|
+
{
|
607
|
+
return __gthread_mutex_trylock (mutex);
|
608
|
+
}
|
609
|
+
|
610
|
+
static inline int
|
611
|
+
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
|
612
|
+
{
|
613
|
+
return __gthread_mutex_unlock (mutex);
|
614
|
+
}
|
615
|
+
|
616
|
+
#endif /* _LIBOBJC */
|
617
|
+
|
618
|
+
#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */
|