| 1 | /* GNU Objective C Runtime Thread Implementation
|
|---|
| 2 | Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
|---|
| 3 | Contributed by Galen C. Hunt ([email protected])
|
|---|
| 4 |
|
|---|
| 5 | This file is part of GNU CC.
|
|---|
| 6 |
|
|---|
| 7 | GNU CC 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 2, or (at your option) any later version.
|
|---|
| 10 |
|
|---|
| 11 | GNU CC 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 | You should have received a copy of the GNU General Public License along with
|
|---|
| 17 | GNU CC; see the file COPYING. If not, write to the Free Software
|
|---|
| 18 | Foundation, 59 Temple Place - Suite 330,
|
|---|
| 19 | Boston, MA 02111-1307, USA. */
|
|---|
| 20 |
|
|---|
| 21 | /* As a special exception, if you link this library with files compiled with
|
|---|
| 22 | GCC to produce an executable, this does not cause the resulting executable
|
|---|
| 23 | to be covered by the GNU General Public License. This exception does not
|
|---|
| 24 | however invalidate any other reasons why the executable file might be
|
|---|
| 25 | covered by the GNU General Public License. */
|
|---|
| 26 |
|
|---|
| 27 | #include <objc/thr.h>
|
|---|
| 28 | #include "runtime.h"
|
|---|
| 29 |
|
|---|
| 30 | /* Thread local storage for a single thread */
|
|---|
| 31 | static void *thread_local_storage = NULL;
|
|---|
| 32 |
|
|---|
| 33 | /* Backend initialization functions */
|
|---|
| 34 |
|
|---|
| 35 | /* Initialize the threads subsystem. */
|
|---|
| 36 | int
|
|---|
| 37 | __objc_init_thread_system(void)
|
|---|
| 38 | {
|
|---|
| 39 | /* No thread support available */
|
|---|
| 40 | return -1;
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | /* Close the threads subsystem. */
|
|---|
| 44 | int
|
|---|
| 45 | __objc_close_thread_system(void)
|
|---|
| 46 | {
|
|---|
| 47 | /* No thread support available */
|
|---|
| 48 | return -1;
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | /* Backend thread functions */
|
|---|
| 52 |
|
|---|
| 53 | /* Create a new thread of execution. */
|
|---|
| 54 | objc_thread_t
|
|---|
| 55 | __objc_thread_detach(void (*func)(void *arg), void *arg)
|
|---|
| 56 | {
|
|---|
| 57 | /* No thread support available */
|
|---|
| 58 | return NULL;
|
|---|
| 59 | }
|
|---|
| 60 |
|
|---|
| 61 | /* Set the current thread's priority. */
|
|---|
| 62 | int
|
|---|
| 63 | __objc_thread_set_priority(int priority)
|
|---|
| 64 | {
|
|---|
| 65 | /* No thread support available */
|
|---|
| 66 | return -1;
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | /* Return the current thread's priority. */
|
|---|
| 70 | int
|
|---|
| 71 | __objc_thread_get_priority(void)
|
|---|
| 72 | {
|
|---|
| 73 | return OBJC_THREAD_INTERACTIVE_PRIORITY;
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 | /* Yield our process time to another thread. */
|
|---|
| 77 | void
|
|---|
| 78 | __objc_thread_yield(void)
|
|---|
|
|---|