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
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
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/>. */
28 # define __gthrw_pragma(pragma) _Pragma (#pragma)
29 /* Define so we provide weak definitions of functions used by libobjc only. */
34 pthread_once (pthread_once_t
*once ATTRIBUTE_UNUSED
,
35 void (*func
) (void) ATTRIBUTE_UNUSED
)
41 pthread_key_create (pthread_key_t
*key ATTRIBUTE_UNUSED
,
42 void (*dtor
) (void *) ATTRIBUTE_UNUSED
)
48 pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED
)
54 pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED
)
60 pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED
,
61 const void *ptr ATTRIBUTE_UNUSED
)
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
)
76 pthread_join (pthread_t thread ATTRIBUTE_UNUSED
,
77 void **value_ptr ATTRIBUTE_UNUSED
)
83 pthread_exit (void *value_ptr ATTRIBUTE_UNUSED
)
88 pthread_detach (pthread_t thread ATTRIBUTE_UNUSED
)
94 pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED
)
100 pthread_mutex_lock (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
106 pthread_mutex_trylock (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
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
)
120 #endif /* _POSIX_TIMEOUTS */
123 pthread_mutex_unlock (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
129 pthread_mutexattr_init (pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
)
135 pthread_mutexattr_settype (pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
,
136 int type ATTRIBUTE_UNUSED
)
142 pthread_mutexattr_destroy (pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
)
148 pthread_cond_broadcast (pthread_cond_t
*cond ATTRIBUTE_UNUSED
)
154 pthread_cond_destroy (pthread_cond_t
*cond ATTRIBUTE_UNUSED
)
160 pthread_cond_init (pthread_cond_t
*cond ATTRIBUTE_UNUSED
,
161 const pthread_condattr_t
*attr ATTRIBUTE_UNUSED
)
167 pthread_cond_signal (pthread_cond_t
*cond ATTRIBUTE_UNUSED
)
173 pthread_cond_wait (pthread_cond_t
*cond ATTRIBUTE_UNUSED
,
174 pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
180 pthread_cond_timedwait (pthread_cond_t
*cond ATTRIBUTE_UNUSED
,
181 pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
,
182 const struct timespec
*abstime ATTRIBUTE_UNUSED
)
188 pthread_mutex_init (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
,
189 const pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
)
195 pthread_mutex_destroy (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
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
)
215 sched_get_priority_min (int policy ATTRIBUTE_UNUSED
)
219 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
220 #endif /* _POSIX_PRIORITY_SCHEDULING */
229 pthread_attr_destroy (pthread_attr_t
*attr ATTRIBUTE_UNUSED
)
235 pthread_attr_init (pthread_attr_t
*attr ATTRIBUTE_UNUSED
)
241 pthread_attr_setdetachstate (pthread_attr_t
*attr ATTRIBUTE_UNUSED
,
242 int detachstate ATTRIBUTE_UNUSED
)
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
)
257 pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED
,
258 int policy ATTRIBUTE_UNUSED
,
259 const struct sched_param
*param ATTRIBUTE_UNUSED
)
263 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */