OSDN Git Service

2008-08-28 Chris Fairles <chris.fairles@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / gthr-posix.c
1 /* POSIX threads dummy routines for systems without weak definitions.  */
2 /* Compile this one with gcc.  */
3 /* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
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
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA.  */
21
22 /* As a special exception, if you link this library with other files,
23    some of which are compiled with GCC, to produce an executable,
24    this library does not by itself cause the resulting executable
25    to be covered by the GNU General Public License.
26    This exception does not however invalidate any other reasons why
27    the executable file might be covered by the GNU General Public License.  */
28
29 #include "tconfig.h"
30 #include "tm.h"
31 # define __gthrw_pragma(pragma) _Pragma (#pragma)
32 /* Define so we provide weak definitions of functions used by libobjc only.  */
33 #define _LIBOBJC_WEAK
34 #include "gthr.h"
35
36 int
37 pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
38               void (*func) (void) ATTRIBUTE_UNUSED)
39 {
40   return -1;
41 }
42
43 int
44 pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
45                     void (*dtor) (void *) ATTRIBUTE_UNUSED)
46 {
47   return -1;
48 }
49
50 int
51 pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
52 {
53   return 0;
54 }
55
56 void *
57 pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
58 {
59   return 0;
60 }
61
62 int
63 pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
64                      const void *ptr ATTRIBUTE_UNUSED)
65 {
66   return 0;
67 }
68
69 int
70 pthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
71                 const pthread_attr_t *attr ATTRIBUTE_UNUSED,
72                 void *(*start_routine) (void *) ATTRIBUTE_UNUSED,
73                 void *arg ATTRIBUTE_UNUSED)
74 {
75   return 0;
76 }
77
78 int 
79 pthread_join (pthread_t thread ATTRIBUTE_UNUSED, 
80               void **value_ptr ATTRIBUTE_UNUSED)
81 {
82   return 0;
83 }
84
85 void
86 pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
87 {
88 }
89
90 int 
91 pthread_detach (pthread_t thread ATTRIBUTE_UNUSED)
92 {
93   return 0;
94 }
95
96 int
97 pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED)
98 {
99   return 0;
100 }
101
102 int
103 pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
104 {
105   return 0;
106 }
107
108 int
109 pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
110 {
111   return 0;
112 }
113
114 #ifdef _POSIX_TIMEOUTS
115 int
116 pthread_mutex_timedlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
117                          const struct timespec *abs_timeout ATTRIBUTE_UNUSED)
118 {
119   return 0;
120 }
121 #endif /* _POSIX_TIMEOUTS */
122
123 int
124 pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
125 {
126   return 0;
127 }
128
129 int
130 pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
131 {
132   return 0;
133 }
134
135 int
136 pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
137                            int type ATTRIBUTE_UNUSED)
138 {
139   return 0;
140 }
141
142 int
143 pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
144 {
145   return 0;
146 }
147
148 int
149 pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
150 {
151   return 0;
152 }
153
154 int
155 pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
156 {
157   return 0;
158 }
159
160 int
161 pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
162                    const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
163 {
164   return 0;
165 }
166
167 int
168 pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
169 {
170   return 0;
171 }
172
173 int
174 pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
175                    pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
176 {
177   return 0;
178 }
179
180 int
181 pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED, \r
182                         pthread_mutex_t *mutex ATTRIBUTE_UNUSED, 
183                         const struct timespec *abstime ATTRIBUTE_UNUSED)
184 {
185   return 0;
186 }
187
188 int
189 pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
190                     const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
191 {
192   return 0;
193 }
194
195 int
196 pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
197 {
198   return 0;
199 }
200
201 pthread_t
202 pthread_self (void)
203 {
204   return (pthread_t) 0;
205 }
206
207 #ifdef _POSIX_PRIORITY_SCHEDULING
208 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
209 int
210 sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
211 {
212   return 0;
213 }
214
215 int
216 sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
217 {
218   return 0;
219 }
220 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
221 #endif /* _POSIX_PRIORITY_SCHEDULING */
222
223 int
224 sched_yield (void)
225 {
226   return 0;
227 }
228
229 int
230 pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
231 {
232   return 0;
233 }
234
235 int
236 pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
237 {
238   return 0;
239 }
240
241 int
242 pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
243                              int detachstate ATTRIBUTE_UNUSED)
244 {
245   return 0;
246 }
247
248 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
249 int
250 pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
251                        int *policy ATTRIBUTE_UNUSED,
252                        struct sched_param *param ATTRIBUTE_UNUSED)
253 {
254   return 0;
255 }
256
257 int
258 pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
259                        int policy ATTRIBUTE_UNUSED,
260                        const struct sched_param *param ATTRIBUTE_UNUSED)
261 {
262   return 0;
263 }
264 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
265