re PR c++/41090 (Using static label reference in c++ class constructor produces wrong...
[official-gcc.git] / libobjc / thr-single.c
blob0074c6916f480cd560020782d75d223aff79566f
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)
5 This file is part of GCC.
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.
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.
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.
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/>. */
26 #include "objc/thr.h"
27 #include "objc/runtime.h"
29 /* Thread local storage for a single thread */
30 static void *thread_local_storage = NULL;
32 /* Backend initialization functions */
34 /* Initialize the threads subsystem. */
35 int
36 __objc_init_thread_system(void)
38 /* No thread support available */
39 return -1;
42 /* Close the threads subsystem. */
43 int
44 __objc_close_thread_system(void)
46 /* No thread support available */
47 return -1;
50 /* Backend thread functions */
52 /* Create a new thread of execution. */
53 objc_thread_t
54 __objc_thread_detach(void (*func)(void *arg), void *arg)
56 /* No thread support available */
57 return NULL;
60 /* Set the current thread's priority. */
61 int
62 __objc_thread_set_priority(int priority)
64 /* No thread support available */
65 return -1;
68 /* Return the current thread's priority. */
69 int
70 __objc_thread_get_priority(void)
72 return OBJC_THREAD_INTERACTIVE_PRIORITY;
75 /* Yield our process time to another thread. */
76 void
77 __objc_thread_yield(void)
79 return;
82 /* Terminate the current thread. */
83 int
84 __objc_thread_exit(void)
86 /* No thread support available */
87 /* Should we really exit the program */
88 /* exit(&__objc_thread_exit_status); */
89 return -1;
92 /* Returns an integer value which uniquely describes a thread. */
93 objc_thread_t
94 __objc_thread_id(void)
96 /* No thread support, use 1. */
97 return (objc_thread_t)1;
100 /* Sets the thread's local storage pointer. */
102 __objc_thread_set_data(void *value)
104 thread_local_storage = value;
105 return 0;
108 /* Returns the thread's local storage pointer. */
109 void *
110 __objc_thread_get_data(void)
112 return thread_local_storage;
115 /* Backend mutex functions */
117 /* Allocate a mutex. */
119 __objc_mutex_allocate(objc_mutex_t mutex)
121 return 0;
124 /* Deallocate a mutex. */
126 __objc_mutex_deallocate(objc_mutex_t mutex)
128 return 0;
131 /* Grab a lock on a mutex. */
133 __objc_mutex_lock(objc_mutex_t mutex)
135 /* There can only be one thread, so we always get the lock */
136 return 0;
139 /* Try to grab a lock on a mutex. */
141 __objc_mutex_trylock(objc_mutex_t mutex)
143 /* There can only be one thread, so we always get the lock */
144 return 0;
147 /* Unlock the mutex */
149 __objc_mutex_unlock(objc_mutex_t mutex)
151 return 0;
154 /* Backend condition mutex functions */
156 /* Allocate a condition. */
158 __objc_condition_allocate(objc_condition_t condition)
160 return 0;
163 /* Deallocate a condition. */
165 __objc_condition_deallocate(objc_condition_t condition)
167 return 0;
170 /* Wait on the condition */
172 __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
174 return 0;
177 /* Wake up all threads waiting on this condition. */
179 __objc_condition_broadcast(objc_condition_t condition)
181 return 0;
184 /* Wake up one thread waiting on this condition. */
186 __objc_condition_signal(objc_condition_t condition)
188 return 0;
191 /* End of File */