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
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING.  If not, write to the Free
19Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
2002110-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
36int
37pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
38	      void (*func) (void) ATTRIBUTE_UNUSED)
39{
40  return -1;
41}
42
43int
44pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
45		    void (*dtor) (void *) ATTRIBUTE_UNUSED)
46{
47  return -1;
48}
49
50int
51pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
52{
53  return 0;
54}
55
56void *
57pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
58{
59  return 0;
60}
61
62int
63pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
64		     const void *ptr ATTRIBUTE_UNUSED)
65{
66  return 0;
67}
68
69int
70pthread_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
78int
79pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED)
80{
81  return 0;
82}
83
84int
85pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
86{
87  return 0;
88}
89
90int
91pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
92{
93  return 0;
94}
95
96int
97pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
98{
99  return 0;
100}
101
102int
103pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
104{
105  return 0;
106}
107
108int
109pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED,
110			   int type ATTRIBUTE_UNUSED)
111{
112  return 0;
113}
114
115int
116pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
117{
118  return 0;
119}
120
121int
122pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
123{
124  return 0;
125}
126
127int
128pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
129{
130  return 0;
131}
132
133int
134pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
135		   const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
136{
137  return 0;
138}
139
140int
141pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
142{
143  return 0;
144}
145
146int
147pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
148		   pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
149{
150  return 0;
151}
152
153void
154pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
155{
156}
157
158int
159pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
160		    const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
161{
162  return 0;
163}
164
165int
166pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
167{
168  return 0;
169}
170
171pthread_t
172pthread_self (void)
173{
174  return (pthread_t) 0;
175}
176#ifdef _POSIX_PRIORITY_SCHEDULING
177#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
178int
179sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
180{
181  return 0;
182}
183
184int
185sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
186{
187  return 0;
188}
189#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
190#endif /* _POSIX_PRIORITY_SCHEDULING */
191
192int
193sched_yield (void)
194{
195  return 0;
196}
197
198int
199pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
200{
201  return 0;
202}
203
204int
205pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
206{
207  return 0;
208}
209
210int
211pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
212			     int detachstate ATTRIBUTE_UNUSED)
213{
214  return 0;
215}
216
217#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
218int
219pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
220		       int *policy ATTRIBUTE_UNUSED,
221		       struct sched_param *param ATTRIBUTE_UNUSED)
222{
223  return 0;
224}
225
226int
227pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
228		       int policy ATTRIBUTE_UNUSED,
229		       const struct sched_param *param ATTRIBUTE_UNUSED)
230{
231  return 0;
232}
233#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
234
235