OLD | NEW |
1 /* Threads compatibility routines for libgcc2. */ | 1 /* Threads compatibility routines for libgcc2. */ |
2 /* Compile this one with gcc. */ | 2 /* Compile this one with gcc. */ |
3 /* Copyright (C) 1997, 1998, 2004, 2008, 2009 Free Software Foundation, Inc. | 3 /* Copyright (C) 1997, 1998, 2004, 2008, 2009 Free Software Foundation, Inc. |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify it under | 7 GCC is free software; you can redistribute it and/or modify it under |
8 the terms of the GNU General Public License as published by the Free | 8 the terms of the GNU General Public License as published by the Free |
9 Software Foundation; either version 3, or (at your option) any later | 9 Software Foundation; either version 3, or (at your option) any later |
10 version. | 10 version. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 Interface: | 95 Interface: |
96 int __gthread_cond_broadcast (__gthread_cond_t *cond); | 96 int __gthread_cond_broadcast (__gthread_cond_t *cond); |
97 int __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex); | 97 int __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex); |
98 int __gthread_cond_wait_recursive (__gthread_cond_t *cond, | 98 int __gthread_cond_wait_recursive (__gthread_cond_t *cond, |
99 __gthread_recursive_mutex_t *mutex); | 99 __gthread_recursive_mutex_t *mutex); |
100 | 100 |
101 All functions returning int should return zero on success or the error | 101 All functions returning int should return zero on success or the error |
102 number. If the operation is not supported, -1 is returned. | 102 number. If the operation is not supported, -1 is returned. |
103 | 103 |
104 If the following are also defined, you should | 104 If the following are also defined, you should |
105 #define __GTHREADS_CXX0X 1 | 105 #define __GTHREADS_CXX0X 1 |
106 to enable the c++0x thread library. | 106 to enable the c++0x thread library. |
107 | 107 |
108 Types: | 108 Types: |
109 __gthread_t | 109 __gthread_t |
110 __gthread_time_t | 110 __gthread_time_t |
111 | 111 |
112 Interface: | 112 Interface: |
113 int __gthread_create (__gthread_t *thread, void *(*func) (void*), | 113 int __gthread_create (__gthread_t *thread, void *(*func) (void*), |
114 void *args); | 114 void *args); |
115 int __gthread_join (__gthread_t thread, void **value_ptr); | 115 int __gthread_join (__gthread_t thread, void **value_ptr); |
116 int __gthread_detach (__gthread_t thread); | 116 int __gthread_detach (__gthread_t thread); |
117 int __gthread_equal (__gthread_t t1, __gthread_t t2); | 117 int __gthread_equal (__gthread_t t1, __gthread_t t2); |
118 __gthread_t __gthread_self (void); | 118 __gthread_t __gthread_self (void); |
119 int __gthread_yield (void); | 119 int __gthread_yield (void); |
120 | 120 |
121 int __gthread_mutex_timedlock (__gthread_mutex_t *m, | 121 int __gthread_mutex_timedlock (__gthread_mutex_t *m, |
122 const __gthread_time_t *abs_timeout); | 122 const __gthread_time_t *abs_timeout); |
123 int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m, | 123 int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m, |
124 const __gthread_time_t *abs_time); | 124 const __gthread_time_t *abs_time); |
125 | 125 |
126 int __gthread_cond_signal (__gthread_cond_t *cond); | 126 int __gthread_cond_signal (__gthread_cond_t *cond); |
127 int __gthread_cond_timedwait (__gthread_cond_t *cond, | 127 int __gthread_cond_timedwait (__gthread_cond_t *cond, |
128 __gthread_mutex_t *mutex, | 128 __gthread_mutex_t *mutex, |
129 const __gthread_time_t *abs_timeout); | 129 const __gthread_time_t *abs_timeout); |
130 int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond, | 130 int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond, |
131 __gthread_recursive_mutex_t *mutex, | 131 __gthread_recursive_mutex_t *mutex, |
132 const __gthread_time_t *abs_time) | 132 const __gthread_time_t *abs_time) |
133 | 133 |
134 Currently supported threads packages are | 134 Currently supported threads packages are |
135 TPF threads with -D__tpf__ | 135 TPF threads with -D__tpf__ |
136 POSIX/Unix98 threads with -D_PTHREADS | 136 POSIX/Unix98 threads with -D_PTHREADS |
137 POSIX/Unix95 threads with -D_PTHREADS95 | 137 POSIX/Unix95 threads with -D_PTHREADS95 |
138 DCE threads with -D_DCE_THREADS | 138 DCE threads with -D_DCE_THREADS |
139 Solaris/UI threads with -D_SOLARIS_THREADS | 139 Solaris/UI threads with -D_SOLARIS_THREADS |
140 | 140 |
141 */ | 141 */ |
142 | 142 |
143 /* Check first for thread specific defines. */ | 143 /* Check first for thread specific defines. */ |
144 #if defined (__tpf__) | 144 #if defined (__tpf__) |
145 #include "gthr-tpf.h" | 145 #include "gthr-tpf.h" |
146 #elif _PTHREADS | 146 #elif _PTHREADS |
147 #include "gthr-posix.h" | 147 #include "gthr-posix.h" |
148 #elif _PTHREADS95 | 148 #elif _PTHREADS95 |
149 #include "gthr-posix95.h" | 149 #include "gthr-posix95.h" |
150 #elif _DCE_THREADS | 150 #elif _DCE_THREADS |
(...skipping 13 matching lines...) Expand all Loading... |
164 /* Fallback to single thread definitions. */ | 164 /* Fallback to single thread definitions. */ |
165 #else | 165 #else |
166 #include "gthr-single.h" | 166 #include "gthr-single.h" |
167 #endif | 167 #endif |
168 | 168 |
169 #ifndef HIDE_EXPORTS | 169 #ifndef HIDE_EXPORTS |
170 #pragma GCC visibility pop | 170 #pragma GCC visibility pop |
171 #endif | 171 #endif |
172 | 172 |
173 #endif /* ! GCC_GTHR_H */ | 173 #endif /* ! GCC_GTHR_H */ |
OLD | NEW |