Fix mdoc(7)/man(7) mix up.
[netbsd-mini2440.git] / gnu / lib / libstdc++-v3_4 / arch / vax / gthr-single.h
blobc0c1dfa734cd3c58b22c3c87835d72dee848e02c
1 /* This file is automatically generated. DO NOT EDIT! */
2 /* Generated from: NetBSD: mknative-gcc,v 1.22 2006/06/25 03:06:15 mrg 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, 1999, 2000, 2004 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 2, 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 You should have received a copy of the GNU General Public License
22 along with GCC; see the file COPYING. If not, write to the Free
23 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
24 02110-1301, USA. */
26 /* As a special exception, if you link this library with other files,
27 some of which are compiled with GCC, to produce an executable,
28 this library does not by itself cause the resulting executable
29 to be covered by the GNU General Public License.
30 This exception does not however invalidate any other reasons why
31 the executable file might be covered by the GNU General Public License. */
33 #ifndef _GLIBCXX_GCC_GTHR_SINGLE_H
34 #define _GLIBCXX_GCC_GTHR_SINGLE_H
36 /* Just provide compatibility for mutex handling. */
38 typedef int __gthread_mutex_t;
39 typedef int __gthread_recursive_mutex_t;
41 #define __GTHREAD_MUTEX_INIT 0
43 #ifdef __cplusplus
44 #define _GLIBCXX_UNUSED(x)
45 #else
46 #define _GLIBCXX_UNUSED(x) x __attribute__((unused))
47 #endif
49 #ifdef _LIBOBJC
51 /* Thread local storage for a single thread */
52 static void *thread_local_storage = NULL;
54 /* Backend initialization functions */
56 /* Initialize the threads subsystem. */
57 static inline int
58 __gthread_objc_init_thread_system (void)
60 /* No thread support available */
61 return -1;
64 /* Close the threads subsystem. */
65 static inline int
66 __gthread_objc_close_thread_system (void)
68 /* No thread support available */
69 return -1;
72 /* Backend thread functions */
74 /* Create a new thread of execution. */
75 static inline objc_thread_t
76 __gthread_objc_thread_detach (void (* func)(void *), void * _GLIBCXX_UNUSED(arg))
78 /* No thread support available */
79 return NULL;
82 /* Set the current thread's priority. */
83 static inline int
84 __gthread_objc_thread_set_priority (int _GLIBCXX_UNUSED(priority))
86 /* No thread support available */
87 return -1;
90 /* Return the current thread's priority. */
91 static inline int
92 __gthread_objc_thread_get_priority (void)
94 return OBJC_THREAD_INTERACTIVE_PRIORITY;
97 /* Yield our process time to another thread. */
98 static inline void
99 __gthread_objc_thread_yield (void)
101 return;
104 /* Terminate the current thread. */
105 static inline int
106 __gthread_objc_thread_exit (void)
108 /* No thread support available */
109 /* Should we really exit the program */
110 /* exit (&__objc_thread_exit_status); */
111 return -1;
114 /* Returns an integer value which uniquely describes a thread. */
115 static inline objc_thread_t
116 __gthread_objc_thread_id (void)
118 /* No thread support, use 1. */
119 return (objc_thread_t) 1;
122 /* Sets the thread's local storage pointer. */
123 static inline int
124 __gthread_objc_thread_set_data (void *value)
126 thread_local_storage = value;
127 return 0;
130 /* Returns the thread's local storage pointer. */
131 static inline void *
132 __gthread_objc_thread_get_data (void)
134 return thread_local_storage;
137 /* Backend mutex functions */
139 /* Allocate a mutex. */
140 static inline int
141 __gthread_objc_mutex_allocate (objc_mutex_t _GLIBCXX_UNUSED(mutex))
143 return 0;
146 /* Deallocate a mutex. */
147 static inline int
148 __gthread_objc_mutex_deallocate (objc_mutex_t _GLIBCXX_UNUSED(mutex))
150 return 0;
153 /* Grab a lock on a mutex. */
154 static inline int
155 __gthread_objc_mutex_lock (objc_mutex_t _GLIBCXX_UNUSED(mutex))
157 /* There can only be one thread, so we always get the lock */
158 return 0;
161 /* Try to grab a lock on a mutex. */
162 static inline int
163 __gthread_objc_mutex_trylock (objc_mutex_t _GLIBCXX_UNUSED(mutex))
165 /* There can only be one thread, so we always get the lock */
166 return 0;
169 /* Unlock the mutex */
170 static inline int
171 __gthread_objc_mutex_unlock (objc_mutex_t _GLIBCXX_UNUSED(mutex))
173 return 0;
176 /* Backend condition mutex functions */
178 /* Allocate a condition. */
179 static inline int
180 __gthread_objc_condition_allocate (objc_condition_t _GLIBCXX_UNUSED(condition))
182 return 0;
185 /* Deallocate a condition. */
186 static inline int
187 __gthread_objc_condition_deallocate (objc_condition_t _GLIBCXX_UNUSED(condition))
189 return 0;
192 /* Wait on the condition */
193 static inline int
194 __gthread_objc_condition_wait (objc_condition_t _GLIBCXX_UNUSED(condition),
195 objc_mutex_t _GLIBCXX_UNUSED(mutex))
197 return 0;
200 /* Wake up all threads waiting on this condition. */
201 static inline int
202 __gthread_objc_condition_broadcast (objc_condition_t _GLIBCXX_UNUSED(condition))
204 return 0;
207 /* Wake up one thread waiting on this condition. */
208 static inline int
209 __gthread_objc_condition_signal (objc_condition_t _GLIBCXX_UNUSED(condition))
211 return 0;
214 #else /* _LIBOBJC */
216 static inline int
217 __gthread_active_p (void)
219 return 0;
222 static inline int
223 __gthread_mutex_lock (__gthread_mutex_t * _GLIBCXX_UNUSED(mutex))
225 return 0;
228 static inline int
229 __gthread_mutex_trylock (__gthread_mutex_t * _GLIBCXX_UNUSED(mutex))
231 return 0;
234 static inline int
235 __gthread_mutex_unlock (__gthread_mutex_t * _GLIBCXX_UNUSED(mutex))
237 return 0;
240 static inline int
241 __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
243 return __gthread_mutex_lock (mutex);
246 static inline int
247 __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
249 return __gthread_mutex_trylock (mutex);
252 static inline int
253 __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
255 return __gthread_mutex_unlock (mutex);
258 #endif /* _LIBOBJC */
260 #undef _GLIBCXX_UNUSED
262 #endif /* ! _GLIBCXX_GCC_GTHR_SINGLE_H */