00001 /* Threads compatibility routines for libgcc2. */ 00002 /* Compile this one with gcc. */ 00003 /* Copyright (C) 2003, 2004 Free Software Foundation, Inc. 00004 00005 This file is part of GCC. 00006 00007 GCC is free software; you can redistribute it and/or modify it under 00008 the terms of the GNU General Public License as published by the Free 00009 Software Foundation; either version 2, or (at your option) any later 00010 version. 00011 00012 GCC is distributed in the hope that it will be useful, but WITHOUT ANY 00013 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with GCC; see the file COPYING. If not, write to the Free 00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 00020 02111-1307, USA. */ 00021 00022 /* As a special exception, if you link this library with other files, 00023 some of which are compiled with GCC, to produce an executable, 00024 this library does not by itself cause the resulting executable 00025 to be covered by the GNU General Public License. 00026 This exception does not however invalidate any other reasons why 00027 the executable file might be covered by the GNU General Public License. */ 00028 00029 #include "gthr-gnat.h" 00030 00031 #ifndef HIDE_EXPORTS 00032 #pragma GCC visibility push(default) 00033 #endif 00034 00035 #ifdef __cplusplus 00036 #define UNUSED(x) 00037 #else 00038 #define UNUSED(x) x __attribute__((unused)) 00039 #endif 00040 00041 void __gnat_default_lock (void); 00042 void __gnat_default_unlock (void); 00043 00044 void 00045 __gnat_default_lock (void) 00046 { 00047 return; 00048 } 00049 00050 void 00051 __gnat_default_unlock (void) 00052 { 00053 return; 00054 } 00055 00056 static void (*__gnat_task_lock) (void) = *__gnat_default_lock; 00057 static void (*__gnat_task_unlock) (void) = *__gnat_default_unlock; 00058 00059 void 00060 __gnat_install_locks (void (*lock) (void), void (*unlock) (void)) 00061 { 00062 __gnat_task_lock = lock; 00063 __gnat_task_unlock = unlock; 00064 } 00065 00066 int 00067 __gthread_active_p (void) 00068 { 00069 return 0; 00070 } 00071 00072 int 00073 __gthread_mutex_lock (__gthread_mutex_t * UNUSED (mutex)) 00074 { 00075 __gnat_task_lock (); 00076 return 0; 00077 } 00078 00079 int 00080 __gthread_mutex_unlock (__gthread_mutex_t * UNUSED (mutex)) 00081 { 00082 __gnat_task_unlock (); 00083 return 0; 00084 } 00085 00086 #ifndef HIDE_EXPORTS 00087 #pragma GCC visibility pop 00088 #endif
1.5.6