2005-03-29 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / gcc / gthr-posix.c
blobc74f3cecea9eebfea605a59e500b38799ca63fc5
1 /* POSIX threads dummy routines for systems without weak definitions. */
2 /* Compile this one with gcc. */
3 /* Copyright (C) 2003, 2004 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, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, 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 so we provide weak definitions of functions used by libobjc only. */
32 #define _LIBOBJC_WEAK
33 #include "gthr.h"
35 int
36 pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED,
37 void (*func) (void) ATTRIBUTE_UNUSED)
39 return -1;
42 int
43 pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED,
44 void (*dtor) (void *) ATTRIBUTE_UNUSED)
46 return -1;
49 int
50 pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED)
52 return 0;
55 void *
56 pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED)
58 return 0;
61 int
62 pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED,
63 const void *ptr ATTRIBUTE_UNUSED)
65 return 0;
68 int
69 pthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
70 const pthread_attr_t *attr ATTRIBUTE_UNUSED,
71 void *(*start_routine) (void *) ATTRIBUTE_UNUSED,
72 void *arg ATTRIBUTE_UNUSED)
74 return 0;
77 int
78 pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
80 return 0;
83 int
84 pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
86 return 0;
89 int
90 pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
92 return 0;
95 int
96 pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED)
98 return 0;
102 pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED)
104 return 0;
108 pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED,
109 const pthread_condattr_t *attr ATTRIBUTE_UNUSED)
111 return 0;
115 pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED)
117 return 0;
121 pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
122 pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
124 return 0;
127 void
128 pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
133 pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
134 const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED)
136 return 0;
140 pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
142 return 0;
145 pthread_t
146 pthread_self (void)
148 return (pthread_t) 0;
150 #ifdef _POSIX_PRIORITY_SCHEDULING
151 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
153 sched_get_priority_max (int policy ATTRIBUTE_UNUSED)
155 return 0;
159 sched_get_priority_min (int policy ATTRIBUTE_UNUSED)
161 return 0;
163 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
164 #endif /* _POSIX_PRIORITY_SCHEDULING */
167 sched_yield (void)
169 return 0;
173 pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED)
175 return 0;
179 pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED)
181 return 0;
185 pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED,
186 int detachstate ATTRIBUTE_UNUSED)
188 return 0;
191 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
193 pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED,
194 int *policy ATTRIBUTE_UNUSED,
195 struct sched_param *param ATTRIBUTE_UNUSED)
197 return 0;
201 pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED,
202 int policy ATTRIBUTE_UNUSED,
203 const struct sched_param *param ATTRIBUTE_UNUSED)
205 return 0;
207 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */