OSDN Git Service

Add comment saying file is deprecated
[pf3gnuchains/gcc-fork.git] / libobjc / thr-rtems.c
1 /* GNU Objective C Runtime Thread Implementation
2    Copyright (C) 1996, 1997, 2009 Free Software Foundation, Inc.
3    Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
4    Renamed from thr-vxworks.c to thr-rtems.c by 
5      Ralf Corsepius (corsepiu@faw.uni-ulm.de)
6      
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it under the
10 terms of the GNU General Public License as published by the Free Software
11 Foundation; either version 3, or (at your option) any later version.
12
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 FITNESS
15 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16 details.
17
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.
21
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/>.  */
26
27
28 #include "objc/thr.h"
29 #include "objc/runtime.h"
30
31 /* Thread local storage for a single thread */
32 static void *thread_local_storage = NULL;
33
34 /* Backend initialization functions */
35
36 /* Initialize the threads subsystem. */
37 int
38 __objc_init_thread_system(void)
39 {
40   /* No thread support available */
41   return -1;
42 }
43
44 /* Close the threads subsystem. */
45 int
46 __objc_close_thread_system(void)
47 {
48   /* No thread support available */
49   return -1;
50 }
51
52 /* Backend thread functions */
53
54 /* Create a new thread of execution. */
55 objc_thread_t
56 __objc_thread_detach(void (*func)(void *arg), void *arg)
57 {
58   /* No thread support available */
59   return NULL;
60 }
61
62 /* Set the current thread's priority. */
63 int
64 __objc_thread_set_priority(int priority)
65 {
66   /* No thread support available */
67   return -1;
68 }
69
70 /* Return the current thread's priority. */
71 int
72 __objc_thread_get_priority(void)
73 {
74   return OBJC_THREAD_INTERACTIVE_PRIORITY;
75 }
76
77 /* Yield our process time to another thread. */
78 void
79 __objc_thread_yield(void)
80 {
81   return;
82 }
83
84 /* Terminate the current thread. */
85 int
86 __objc_thread_exit(void)
87 {
88   /* No thread support available */
89   /* Should we really exit the program */
90   /* exit(&__objc_thread_exit_status); */
91   return -1;
92 }
93
94 /* Returns an integer value which uniquely describes a thread. */
95 objc_thread_t
96 __objc_thread_id(void)
97 {
98   /* No thread support, use 1. */
99   return (objc_thread_t)1;
100 }
101
102 /* Sets the thread's local storage pointer. */
103 int
104 __objc_thread_set_data(void *value)
105 {
106   thread_local_storage = value;
107   return 0;
108 }
109
110 /* Returns the thread's local storage pointer. */
111 void *
112 __objc_thread_get_data(void)
113 {
114   return thread_local_storage;
115 }
116
117 /* Backend mutex functions */
118
119 /* Allocate a mutex. */
120 int
121 __objc_mutex_allocate(objc_mutex_t mutex)
122 {
123   return 0;
124 }
125
126 /* Deallocate a mutex. */
127 int
128 __objc_mutex_deallocate(objc_mutex_t mutex)
129 {
130   return 0;
131 }
132
133 /* Grab a lock on a mutex. */
134 int
135 __objc_mutex_lock(objc_mutex_t mutex)
136 {
137   /* There can only be one thread, so we always get the lock */
138   return 0;
139 }
140
141 /* Try to grab a lock on a mutex. */
142 int
143 __objc_mutex_trylock(objc_mutex_t mutex)
144 {
145   /* There can only be one thread, so we always get the lock */
146   return 0;
147 }
148
149 /* Unlock the mutex */
150 int
151 __objc_mutex_unlock(objc_mutex_t mutex)
152 {
153   return 0;
154 }
155
156 /* Backend condition mutex functions */
157
158 /* Allocate a condition. */
159 int
160 __objc_condition_allocate(objc_condition_t condition)
161 {
162   return 0;
163 }
164
165 /* Deallocate a condition. */
166 int
167 __objc_condition_deallocate(objc_condition_t condition)
168 {
169   return 0;
170 }
171
172 /* Wait on the condition */
173 int
174 __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
175 {
176   return 0;
177 }
178
179 /* Wake up all threads waiting on this condition. */
180 int
181 __objc_condition_broadcast(objc_condition_t condition)
182 {
183   return 0;
184 }
185
186 /* Wake up one thread waiting on this condition. */
187 int
188 __objc_condition_signal(objc_condition_t condition)
189 {
190   return 0;
191 }
192
193 /* End of File */