PR target/49824
[official-gcc.git] / gcc / gthr-posix.c
blob1987ba738c2c242fc913626b881a246a26afdf6b
1 /* POSIX threads dummy routines for systems without weak definitions. */
2 /* Compile this one with gcc. */
3 /* Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 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 3, 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 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 #include "tconfig.h"
27 #include "tm.h"
28 # define __gthrw_pragma(pragma) _Pragma (#pragma)
29 /* Define so we provide weak definitions of functions used by libobjc only. */
30 #define _LIBOBJC_WEAK
31 #include "gthr.h"
33 int
34 pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
35 void (*func) (void) ATTRIBUTE_UNUSED)
37 return -1;
40 int
41 pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
42 void (*dtor) (void *) ATTRIBUTE_UNUSED)
44 return -1;
47 int
48 pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
50 return 0;
53 void *
54 pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
56 return 0;
59 int
60 pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
61 const void *ptr ATTRIBUTE_UNUSED)
63 return 0;
66 int
67 pthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
68 const pthread_attr_t *attr ATTRIBUTE_UNUSED,
69 void *(*start_routine) (void *) ATTRIBUTE_UNUSED,
70 void *arg ATTRIBUTE_UNUSED)
72 return 0;
75 int
76 pthread_join (pthread_t thread ATTRIBUTE_UNUSED,
77 void **value_ptr ATTRIBUTE_UNUSED)
79 return 0;
82 void
83 pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
87 int
88 pthread_detach (pthread_t thread ATTRIBUTE_UNUSED)
90 return 0;
93 int
94 pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED)
96 return 0;
99 int
100 pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
102 return 0;
106 pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
108 return 0;
111 #ifdef _POSIX_TIMEOUTS
112 #if _POSIX_TIMEOUTS >= 0
114 pthread_mutex_timedlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
115 const struct timespec *abs_timeout ATTRIBUTE_UNUSED)
117 return 0;
119 #endif
120 #endif /* _POSIX_TIMEOUTS */
123 pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
125 return 0;
129 pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
131 return 0;
135 pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
136 int type ATTRIBUTE_UNUSED)
138 return 0;
142 pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
144 return 0;
148 pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
150 return 0;
154 pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
156 return 0;
160 pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
161 const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
163 return 0;
167 pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
169 return 0;
173 pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
174 pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
176 return 0;
180 pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
181 pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
182 const struct timespec *abstime ATTRIBUTE_UNUSED)
184 return 0;
188 pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
189 const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
191 return 0;
195 pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
197 return 0;
200 pthread_t
201 pthread_self (void)
203 return (pthread_t) 0;
206 #ifdef _POSIX_PRIORITY_SCHEDULING
207 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
209 sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
211 return 0;
215 sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
217 return 0;
219 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
220 #endif /* _POSIX_PRIORITY_SCHEDULING */
223 sched_yield (void)
225 return 0;
229 pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
231 return 0;
235 pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
237 return 0;
241 pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
242 int detachstate ATTRIBUTE_UNUSED)
244 return 0;
247 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
249 pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
250 int *policy ATTRIBUTE_UNUSED,
251 struct sched_param *param ATTRIBUTE_UNUSED)
253 return 0;
257 pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
258 int policy ATTRIBUTE_UNUSED,
259 const struct sched_param *param ATTRIBUTE_UNUSED)
261 return 0;
263 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */