gthr-posix.c revision 132718
1/* POSIX threads dummy routines for systems without weak definitions. */ 2/* Compile this one with gcc. */ 3/* Copyright (C) 2003 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify it under 8the terms of the GNU General Public License as published by the Free 9Software Foundation; either version 2, or (at your option) any later 10version. 11 12GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13WARRANTY; without even the implied warranty of MERCHANTABILITY or 14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15for more details. 16 17You should have received a copy of the GNU General Public License 18along with GCC; see the file COPYING. If not, write to the Free 19Software Foundation, 59 Temple Place - Suite 330, Boston, MA 2002111-1307, USA. */ 21 22/* As a special exception, if you link this library with other files, 23 some of which are compiled with GCC, to produce an executable, 24 this library does not by itself cause the resulting executable 25 to be covered by the GNU General Public License. 26 This exception does not however invalidate any other reasons why 27 the executable file might be covered by the GNU General Public License. */ 28 29#include "tconfig.h" 30#include "tm.h" 31/* Define so we provide weak definitions of functions used by libobjc only. */ 32#define _LIBOBJC_WEAK 33#include "gthr.h" 34 35int 36pthread_once (pthread_once_t *once ATTRIBUTE_UNUSED, 37 void (*func) (void) ATTRIBUTE_UNUSED) 38{ 39 return -1; 40} 41 42int 43pthread_key_create (pthread_key_t *key ATTRIBUTE_UNUSED, 44 void (*dtor) (void *) ATTRIBUTE_UNUSED) 45{ 46 return -1; 47} 48 49int 50pthread_key_delete (pthread_key_t key ATTRIBUTE_UNUSED) 51{ 52 return 0; 53} 54 55void * 56pthread_getspecific (pthread_key_t key ATTRIBUTE_UNUSED) 57{ 58 return 0; 59} 60 61int 62pthread_setspecific (pthread_key_t key ATTRIBUTE_UNUSED, 63 const void *ptr ATTRIBUTE_UNUSED) 64{ 65 return 0; 66} 67 68int 69pthread_create (pthread_t *thread ATTRIBUTE_UNUSED, 70 const pthread_attr_t *attr ATTRIBUTE_UNUSED, 71 void *(*start_routine) (void *) ATTRIBUTE_UNUSED, 72 void *arg ATTRIBUTE_UNUSED) 73{ 74 return 0; 75} 76 77int 78pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED) 79{ 80 return 0; 81} 82 83int 84pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED) 85{ 86 return 0; 87} 88 89int 90pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED) 91{ 92 return 0; 93} 94 95int 96pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED) 97{ 98 return 0; 99} 100 101int 102pthread_cond_destroy (pthread_cond_t *cond ATTRIBUTE_UNUSED) 103{ 104 return 0; 105} 106 107int 108pthread_cond_init (pthread_cond_t *cond ATTRIBUTE_UNUSED, 109 const pthread_condattr_t *attr ATTRIBUTE_UNUSED) 110{ 111 return 0; 112} 113 114int 115pthread_cond_signal (pthread_cond_t *cond ATTRIBUTE_UNUSED) 116{ 117 return 0; 118} 119 120int 121pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED, 122 pthread_mutex_t *mutex ATTRIBUTE_UNUSED) 123{ 124 return 0; 125} 126 127void 128pthread_exit (void *value_ptr ATTRIBUTE_UNUSED) 129{ 130} 131 132int 133pthread_mutex_init (pthread_mutex_t *mutex ATTRIBUTE_UNUSED, 134 const pthread_mutexattr_t *attr ATTRIBUTE_UNUSED) 135{ 136 return 0; 137} 138 139int 140pthread_mutex_destroy (pthread_mutex_t *mutex ATTRIBUTE_UNUSED) 141{ 142 return 0; 143} 144 145pthread_t 146pthread_self (void) 147{ 148 return (pthread_t) 0; 149} 150 151#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING 152int 153sched_get_priority_max (int policy ATTRIBUTE_UNUSED) 154{ 155 return 0; 156} 157 158int 159sched_get_priority_min (int policy ATTRIBUTE_UNUSED) 160{ 161 return 0; 162} 163#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ 164 165int 166sched_yield (void) 167{ 168 return 0; 169} 170 171int 172pthread_attr_destroy (pthread_attr_t *attr ATTRIBUTE_UNUSED) 173{ 174 return 0; 175} 176 177int 178pthread_attr_init (pthread_attr_t *attr ATTRIBUTE_UNUSED) 179{ 180 return 0; 181} 182 183int 184pthread_attr_setdetachstate (pthread_attr_t *attr ATTRIBUTE_UNUSED, 185 int detachstate ATTRIBUTE_UNUSED) 186{ 187 return 0; 188} 189 190#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING 191int 192pthread_getschedparam (pthread_t thread ATTRIBUTE_UNUSED, 193 int *policy ATTRIBUTE_UNUSED, 194 struct sched_param *param ATTRIBUTE_UNUSED) 195{ 196 return 0; 197} 198 199int 200pthread_setschedparam (pthread_t thread ATTRIBUTE_UNUSED, 201 int policy ATTRIBUTE_UNUSED, 202 const struct sched_param *param ATTRIBUTE_UNUSED) 203{ 204 return 0; 205} 206#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ 207 208