OSDN Git Service

* doc/configfiles.texi (Configuration Files): Removed
[pf3gnuchains/gcc-fork.git] / libobjc / thr-single.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
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under the
8 terms of the GNU General Public License as published by the Free Software
9 Foundation; either version 3, or (at your option) any later version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
14 details.
15
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
19
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23 <http://www.gnu.org/licenses/>.  */
24
25
26 #include "objc/thr.h"
27 #include "objc/runtime.h"
28
29 /* Thread local storage for a single thread */
30 static void *thread_local_storage = NULL;
31
32 /* Backend initialization functions */
33
34 /* Initialize the threads subsystem. */
35 int
36 __objc_init_thread_system(void)
37 {
38   /* No thread support available */
39   return -1;
40 }
41
42 /* Close the threads subsystem. */
43 int
44 __objc_close_thread_system(void)
45 {
46   /* No thread support available */
47   return -1;
48 }
49
50 /* Backend thread functions */
51
52 /* Create a new thread of execution. */
53 objc_thread_t
54 __objc_thread_detach(void (*func)(void *arg), void *arg)
55 {
56   /* No thread support available */
57   return NULL;
58 }
59
60 /* Set the current thread's priority. */
61 int
62 __objc_thread_set_priority(int priority)
63 {
64   /* No thread support available */
65   return -1;
66 }
67
68 /* Return the current thread's priority. */
69 int
70 __objc_thread_get_priority(void)
71 {
72   return OBJC_THREAD_INTERACTIVE_PRIORITY;
73 }
74
75 /* Yield our process time to another thread. */
76 void
77 __objc_thread_yield(void)
78 {
79   return;
80 }
81
82 /* Terminate the current thread. */
83 int
84 __objc_thread_exit(void)
85 {
86   /* No thread support available */
87   /* Should we really exit the program */
88   /* exit(&__objc_thread_exit_status); */
89   return -1;
90 }
91
92 /* Returns an integer value which uniquely describes a thread. */
93 objc_thread_t
94 __objc_thread_id(void)
95 {
96   /* No thread support, use 1. */
97   return (objc_thread_t)1;
98 }
99
100 /* Sets the thread's local storage pointer. */
101 int
102 __objc_thread_set_data(void *value)
103 {
104   thread_local_storage = value;
105   return 0;
106 }
107
108 /* Returns the thread's local storage pointer. */
109 void *
110 __objc_thread_get_data(void)
111 {
112   return thread_local_storage;
113 }
114
115 /* Backend mutex functions */
116
117 /* Allocate a mutex. */
118 int
119 __objc_mutex_allocate(objc_mutex_t mutex)
120 {
121   return 0;
122 }
123
124 /* Deallocate a mutex. */
125 int
126 __objc_mutex_deallocate(objc_mutex_t mutex)
127 {
128   return 0;
129 }
130
131 /* Grab a lock on a mutex. */
132 int
133 __objc_mutex_lock(objc_mutex_t mutex)
134 {
135   /* There can only be one thread, so we always get the lock */
136   return 0;
137 }
138
139 /* Try to grab a lock on a mutex. */
140 int
141 __objc_mutex_trylock(objc_mutex_t mutex)
142 {
143   /* There can only be one thread, so we always get the lock */
144   return 0;
145 }
146
147 /* Unlock the mutex */
148 int
149 __objc_mutex_unlock(objc_mutex_t mutex)
150 {
151   return 0;
152 }
153
154 /* Backend condition mutex functions */
155
156 /* Allocate a condition. */
157 int
158 __objc_condition_allocate(objc_condition_t condition)
159 {
160   return 0;
161 }
162
163 /* Deallocate a condition. */
164 int
165 __objc_condition_deallocate(objc_condition_t condition)
166 {
167   return 0;
168 }
169
170 /* Wait on the condition */
171 int
172 __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
173 {
174   return 0;
175 }
176
177 /* Wake up all threads waiting on this condition. */
178 int
179 __objc_condition_broadcast(objc_condition_t condition)
180 {
181   return 0;
182 }
183
184 /* Wake up one thread waiting on this condition. */
185 int
186 __objc_condition_signal(objc_condition_t condition)
187 {
188   return 0;
189 }
190
191 /* End of File */