X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fgthr-rtems.h;h=e926d534c5e9b0492271eb60f188f21a1bda92ac;hb=9ec0fbe12f5d88044672d79ff164eff1d2ec3f94;hp=73152528aedd7482ac2c7b8aa6aaa6010e4ab68f;hpb=1134ce4398eac13e4c14c32fb1f84dab6ffda605;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/gthr-rtems.h b/gcc/gthr-rtems.h index 73152528aed..e926d534c5e 100644 --- a/gcc/gthr-rtems.h +++ b/gcc/gthr-rtems.h @@ -1,7 +1,8 @@ /* RTEMS threads compatibility routines for libgcc2 and libobjc. by: Rosimildo da Silva( rdasilva@connecttel.com ) */ /* Compile this one with gcc. */ -/* Copyright (C) 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2000, 2002, 2003, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -17,8 +18,8 @@ for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ /* As a special exception, if you link this library with other files, some of which are compiled with GCC, to produce an executable, @@ -37,13 +38,14 @@ extern "C" { #define __GTHREADS 1 #define __GTHREAD_ONCE_INIT 0 -#define __GTHREAD_MUTEX_INIT 0 #define __GTHREAD_MUTEX_INIT_FUNCTION rtems_gxx_mutex_init +#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION rtems_gxx_recursive_mutex_init /* Avoid dependency on rtems specific headers. */ typedef void *__gthread_key_t; typedef int __gthread_once_t; typedef void *__gthread_mutex_t; +typedef void *__gthread_recursive_mutex_t; /* * External functions provided by RTEMS. They are very similar to their POSIX @@ -60,10 +62,16 @@ extern int rtems_gxx_setspecific (__gthread_key_t key, const void *ptr); /* mutex support */ extern void rtems_gxx_mutex_init (__gthread_mutex_t *mutex); +extern int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex); extern int rtems_gxx_mutex_lock (__gthread_mutex_t *mutex); extern int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex); extern int rtems_gxx_mutex_unlock (__gthread_mutex_t *mutex); +/* recursive mutex support */ +extern void rtems_gxx_recursive_mutex_init (__gthread_recursive_mutex_t *mutex); +extern int rtems_gxx_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex); +extern int rtems_gxx_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex); +extern int rtems_gxx_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex); /* RTEMS threading is always active */ static inline int @@ -104,6 +112,12 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr) } static inline int +__gthread_mutex_destroy (__gthread_mutex_t *mutex) +{ + return rtems_gxx_mutex_destroy (mutex); +} + +static inline int __gthread_mutex_lock (__gthread_mutex_t *mutex) { return rtems_gxx_mutex_lock (mutex); @@ -121,6 +135,24 @@ __gthread_mutex_unlock (__gthread_mutex_t *mutex) return rtems_gxx_mutex_unlock( mutex ); } +static inline int +__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex) +{ + return rtems_gxx_recursive_mutex_lock (mutex); +} + +static inline int +__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex) +{ + return rtems_gxx_recursive_mutex_trylock (mutex); +} + +static inline int +__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex) +{ + return rtems_gxx_recursive_mutex_unlock( mutex ); +} + #ifdef __cplusplus } #endif