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, 2011
4 Free Software Foundation, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. */
29 #include "libgcc_tm.h"
30 # define __gthrw_pragma(pragma) _Pragma (#pragma)
31 /* Define so we provide weak definitions of functions used by libobjc only. */
36 pthread_once (pthread_once_t
*once ATTRIBUTE_UNUSED
,
37 void (*func
) (void) ATTRIBUTE_UNUSED
)
43 pthread_key_create (pthread_key_t
*key ATTRIBUTE_UNUSED
,
44 void (*dtor
) (void *) ATTRIBUTE_UNUSED
)
50 pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED
)
56 pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED
)
62 pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED
,
63 const void *ptr ATTRIBUTE_UNUSED
)
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
)
78 pthread_join (pthread_t thread ATTRIBUTE_UNUSED
,
79 void **value_ptr ATTRIBUTE_UNUSED
)
85 pthread_exit (void *value_ptr ATTRIBUTE_UNUSED
)
90 pthread_detach (pthread_t thread ATTRIBUTE_UNUSED
)
96 pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED
)
102 pthread_mutex_lock (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
108 pthread_mutex_trylock (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
113 #ifdef _POSIX_TIMEOUTS
114 #if _POSIX_TIMEOUTS >= 0
116 pthread_mutex_timedlock (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
,
117 const struct timespec
*abs_timeout ATTRIBUTE_UNUSED
)
122 #endif /* _POSIX_TIMEOUTS */
125 pthread_mutex_unlock (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
131 pthread_mutexattr_init (pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
)
137 pthread_mutexattr_settype (pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
,
138 int type ATTRIBUTE_UNUSED
)
144 pthread_mutexattr_destroy (pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
)
150 pthread_cond_broadcast (pthread_cond_t
*cond ATTRIBUTE_UNUSED
)
156 pthread_cond_destroy (pthread_cond_t
*cond ATTRIBUTE_UNUSED
)
162 pthread_cond_init (pthread_cond_t
*cond ATTRIBUTE_UNUSED
,
163 const pthread_condattr_t
*attr ATTRIBUTE_UNUSED
)
169 pthread_cond_signal (pthread_cond_t
*cond ATTRIBUTE_UNUSED
)
175 pthread_cond_wait (pthread_cond_t
*cond ATTRIBUTE_UNUSED
,
176 pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
182 pthread_cond_timedwait (pthread_cond_t
*cond ATTRIBUTE_UNUSED
,
183 pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
,
184 const struct timespec
*abstime ATTRIBUTE_UNUSED
)
190 pthread_mutex_init (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
,
191 const pthread_mutexattr_t
*attr ATTRIBUTE_UNUSED
)
197 pthread_mutex_destroy (pthread_mutex_t
*mutex ATTRIBUTE_UNUSED
)
205 return (pthread_t
) 0;
208 #ifdef _POSIX_PRIORITY_SCHEDULING
209 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
211 sched_get_priority_max (int policy ATTRIBUTE_UNUSED
)
217 sched_get_priority_min (int policy ATTRIBUTE_UNUSED
)
221 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
222 #endif /* _POSIX_PRIORITY_SCHEDULING */
231 pthread_attr_destroy (pthread_attr_t
*attr ATTRIBUTE_UNUSED
)
237 pthread_attr_init (pthread_attr_t
*attr ATTRIBUTE_UNUSED
)
243 pthread_attr_setdetachstate (pthread_attr_t
*attr ATTRIBUTE_UNUSED
,
244 int detachstate ATTRIBUTE_UNUSED
)
249 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
251 pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED
,
252 int *policy ATTRIBUTE_UNUSED
,
253 struct sched_param
*param ATTRIBUTE_UNUSED
)
259 pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED
,
260 int policy ATTRIBUTE_UNUSED
,
261 const struct sched_param
*param ATTRIBUTE_UNUSED
)
265 #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */