2008-12-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[official-gcc.git] / gcc / gthr-posix.c
blob154fc339416451bcc2c15dbfc8b50ecb3654945d
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.
5 This file is part of GCC.
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.
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.
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. */
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. */
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"
36 int
37 pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
38 void (*func) (void) ATTRIBUTE_UNUSED)
40 return -1;
43 int
44 pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
45 void (*dtor) (void *) ATTRIBUTE_UNUSED)
47 return -1;
50 int
51 pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
53 return 0;
56 void *
57 pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
59 return 0;
62 int
63 pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
64 const void *ptr ATTRIBUTE_UNUSED)
66 return 0;
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)
75 return 0;
78 int
79 pthread_join (pthread_t thread ATTRIBUTE_UNUSED,
80 void **value_ptr ATTRIBUTE_UNUSED)
82 return 0;
85 void
86 pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
90 int
91 pthread_detach (pthread_t thread ATTRIBUTE_UNUSED)
93 return 0;
96 int
97 pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED)
99 return 0;
103 pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
105 return 0;
109 pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
111 return 0;
114 #ifdef _POSIX_TIMEOUTS
115 #if _POSIX_TIMEOUTS >= 0
117 pthread_mutex_timedlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
118 const struct timespec *abs_timeout ATTRIBUTE_UNUSED)
120 return 0;
122 #endif
123 #endif /* _POSIX_TIMEOUTS */
126 pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
128 return 0;
132 pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
134 return 0;
138 pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
139 int type ATTRIBUTE_UNUSED)
141 return 0;
145 pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
147 return 0;
151 pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
153 return 0;
157 pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
159 return 0;
163 pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
164 const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
166 return 0;
170 pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
172 return 0;
176 pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
177 pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
179 return 0;
183 pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
184 pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
185 const struct timespec *abstime ATTRIBUTE_UNUSED)
187 return 0;
191 pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
192 const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
194 return 0;
198 pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
200 return 0;
203 pthread_t
204 pthread_self (void)
206 return (pthread_t) 0;
209 #ifdef _POSIX_PRIORITY_SCHEDULING
210 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
212 sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
214 return 0;
218 sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
220 return 0;
222 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
223 #endif /* _POSIX_PRIORITY_SCHEDULING */
226 sched_yield (void)
228 return 0;
232 pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
234 return 0;
238 pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
240 return 0;
244 pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
245 int detachstate ATTRIBUTE_UNUSED)
247 return 0;
250 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
252 pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
253 int *policy ATTRIBUTE_UNUSED,
254 struct sched_param *param ATTRIBUTE_UNUSED)
256 return 0;
260 pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
261 int policy ATTRIBUTE_UNUSED,
262 const struct sched_param *param ATTRIBUTE_UNUSED)
264 return 0;
266 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */