Remove building with NOCRYPTO option
[minix.git] / external / gpl3 / gcc / lib / libstdc++-v3 / arch / or1k / gthr-single.h
bloba874d3a7dc07561ea4ce517a20d0caf6bb3abe63
1 /* This file is automatically generated. DO NOT EDIT! */
2 /* Generated from: NetBSD: mknative-gcc,v 1.70 2013/05/05 07:11:34 skrll Exp */
3 /* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */
5 /* Threads compatibility routines for libgcc2 and libobjc. */
6 /* Compile this one with gcc. */
7 /* Copyright (C) 1997-2013 Free Software Foundation, Inc.
9 This file is part of GCC.
11 GCC is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free
13 Software Foundation; either version 3, or (at your option) any later
14 version.
16 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
17 WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 for more details.
21 Under Section 7 of GPL version 3, you are granted additional
22 permissions described in the GCC Runtime Library Exception, version
23 3.1, as published by the Free Software Foundation.
25 You should have received a copy of the GNU General Public License and
26 a copy of the GCC Runtime Library Exception along with this program;
27 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
28 <http://www.gnu.org/licenses/>. */
30 #ifndef _GLIBCXX_GCC_GTHR_SINGLE_H
31 #define _GLIBCXX_GCC_GTHR_SINGLE_H
33 /* Just provide compatibility for mutex handling. */
35 typedef int __gthread_key_t;
36 typedef int __gthread_once_t;
37 typedef int __gthread_mutex_t;
38 typedef int __gthread_recursive_mutex_t;
40 #define __GTHREAD_ONCE_INIT 0
41 #define __GTHREAD_MUTEX_INIT 0
42 #define __GTHREAD_MUTEX_INIT_FUNCTION(mx)
43 #define __GTHREAD_RECURSIVE_MUTEX_INIT 0
45 #define _GLIBCXX_UNUSED __attribute__((unused))
47 #ifdef _LIBOBJC
49 /* Thread local storage for a single thread */
50 static void *thread_local_storage = NULL;
52 /* Backend initialization functions */
54 /* Initialize the threads subsystem. */
55 static inline int
56 __gthread_objc_init_thread_system (void)
58 /* No thread support available */
59 return -1;
62 /* Close the threads subsystem. */
63 static inline int
64 __gthread_objc_close_thread_system (void)
66 /* No thread support available */
67 return -1;
70 /* Backend thread functions */
72 /* Create a new thread of execution. */
73 static inline objc_thread_t
74 __gthread_objc_thread_detach (void (* func)(void *), void * arg _GLIBCXX_UNUSED)
76 /* No thread support available */
77 return NULL;
80 /* Set the current thread's priority. */
81 static inline int
82 __gthread_objc_thread_set_priority (int priority _GLIBCXX_UNUSED)
84 /* No thread support available */
85 return -1;
88 /* Return the current thread's priority. */
89 static inline int
90 __gthread_objc_thread_get_priority (void)
92 return OBJC_THREAD_INTERACTIVE_PRIORITY;
95 /* Yield our process time to another thread. */
96 static inline void
97 __gthread_objc_thread_yield (void)
99 return;
102 /* Terminate the current thread. */
103 static inline int
104 __gthread_objc_thread_exit (void)
106 /* No thread support available */
107 /* Should we really exit the program */
108 /* exit (&__objc_thread_exit_status); */
109 return -1;
112 /* Returns an integer value which uniquely describes a thread. */
113 static inline objc_thread_t
114 __gthread_objc_thread_id (void)
116 /* No thread support, use 1. */
117 return (objc_thread_t) 1;
120 /* Sets the thread's local storage pointer. */
121 static inline int
122 __gthread_objc_thread_set_data (void *value)
124 thread_local_storage = value;
125 return 0;
128 /* Returns the thread's local storage pointer. */
129 static inline void *
130 __gthread_objc_thread_get_data (void)
132 return thread_local_storage;
135 /* Backend mutex functions */
137 /* Allocate a mutex. */
138 static inline int
139 __gthread_objc_mutex_allocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
141 return 0;
144 /* Deallocate a mutex. */
145 static inline int
146 __gthread_objc_mutex_deallocate (objc_mutex_t mutex _GLIBCXX_UNUSED)
148 return 0;
151 /* Grab a lock on a mutex. */
152 static inline int
153 __gthread_objc_mutex_lock (objc_mutex_t mutex _GLIBCXX_UNUSED)
155 /* There can only be one thread, so we always get the lock */
156 return 0;
159 /* Try to grab a lock on a mutex. */
160 static inline int
161 __gthread_objc_mutex_trylock (objc_mutex_t mutex _GLIBCXX_UNUSED)
163 /* There can only be one thread, so we always get the lock */
164 return 0;
167 /* Unlock the mutex */
168 static inline int
169 __gthread_objc_mutex_unlock (objc_mutex_t mutex _GLIBCXX_UNUSED)
171 return 0;
174 /* Backend condition mutex functions */
176 /* Allocate a condition. */
177 static inline int
178 __gthread_objc_condition_allocate (objc_condition_t condition _GLIBCXX_UNUSED)
180 return 0;
183 /* Deallocate a condition. */
184 static inline int
185 __gthread_objc_condition_deallocate (objc_condition_t condition _GLIBCXX_UNUSED)
187 return 0;
190 /* Wait on the condition */
191 static inline int
192 __gthread_objc_condition_wait (objc_condition_t condition _GLIBCXX_UNUSED,
193 objc_mutex_t mutex _GLIBCXX_UNUSED)
195 return 0;
198 /* Wake up all threads waiting on this condition. */
199 static inline int
200 __gthread_objc_condition_broadcast (objc_condition_t condition _GLIBCXX_UNUSED)
202 return 0;
205 /* Wake up one thread waiting on this condition. */
206 static inline int
207 __gthread_objc_condition_signal (objc_condition_t condition _GLIBCXX_UNUSED)
209 return 0;
212 #else /* _LIBOBJC */
214 static inline int
215 __gthread_active_p (void)
217 return 0;
220 static inline int
221 __gthread_once (__gthread_once_t *__once _GLIBCXX_UNUSED, void (*__func) (void) _GLIBCXX_UNUSED)
223 return 0;
226 static inline int _GLIBCXX_UNUSED
227 __gthread_key_create (__gthread_key_t *__key _GLIBCXX_UNUSED, void (*__func) (void *) _GLIBCXX_UNUSED)
229 return 0;
232 static int _GLIBCXX_UNUSED
233 __gthread_key_delete (__gthread_key_t __key _GLIBCXX_UNUSED)
235 return 0;
238 static inline void *
239 __gthread_getspecific (__gthread_key_t __key _GLIBCXX_UNUSED)
241 return 0;
244 static inline int
245 __gthread_setspecific (__gthread_key_t __key _GLIBCXX_UNUSED, const void *__v _GLIBCXX_UNUSED)
247 return 0;
250 static inline int
251 __gthread_mutex_destroy (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
253 return 0;
256 static inline int
257 __gthread_mutex_lock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
259 return 0;
262 static inline int
263 __gthread_mutex_trylock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
265 return 0;
268 static inline int
269 __gthread_mutex_unlock (__gthread_mutex_t *__mutex _GLIBCXX_UNUSED)
271 return 0;
274 static inline int
275 __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
277 return __gthread_mutex_lock (__mutex);
280 static inline int
281 __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
283 return __gthread_mutex_trylock (__mutex);
286 static inline int
287 __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
289 return __gthread_mutex_unlock (__mutex);
292 static inline int
293 __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
295 return __gthread_mutex_destroy (__mutex);
298 #endif /* _LIBOBJC */
300 #undef _GLIBCXX_UNUSED
302 #endif /* ! _GLIBCXX_GCC_GTHR_SINGLE_H */