diff options
author | kan <kan@FreeBSD.org> | 2007-05-19 01:19:51 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2007-05-19 01:19:51 +0000 |
commit | 1f9ea4d0a40cca64d60cf4dab152349da7b9dddf (patch) | |
tree | 0cb530c9c38af219e6dda2994c078b6b2b9ad853 /contrib/gcc/gthr-rtems.h | |
parent | 4895159b2b4f648051c1f139faa7b6dc50c2bfcb (diff) | |
download | FreeBSD-src-1f9ea4d0a40cca64d60cf4dab152349da7b9dddf.zip FreeBSD-src-1f9ea4d0a40cca64d60cf4dab152349da7b9dddf.tar.gz |
GCC 4.2.0 release.
Diffstat (limited to 'contrib/gcc/gthr-rtems.h')
-rw-r--r-- | contrib/gcc/gthr-rtems.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/contrib/gcc/gthr-rtems.h b/contrib/gcc/gthr-rtems.h index 7315252..6069f19 100644 --- a/contrib/gcc/gthr-rtems.h +++ b/contrib/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, @@ -39,11 +40,13 @@ extern "C" { #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 @@ -64,6 +67,11 @@ 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 @@ -121,6 +129,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 |