aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2005-01-13 16:50:07 +0100
committerRalf Corsepius <corsepiu@gcc.gnu.org>2005-01-13 16:50:07 +0100
commit5d58d2f83e3c3ff7d5240b240f39dddcb2399131 (patch)
tree988f5e5cb4b36f808f334be94f3fd8e18f052914
parent52786878fd5e664ec19bb0121391b04d8e6ebad0 (diff)
downloadgcc-5d58d2f83e3c3ff7d5240b240f39dddcb2399131.zip
gcc-5d58d2f83e3c3ff7d5240b240f39dddcb2399131.tar.gz
gcc-5d58d2f83e3c3ff7d5240b240f39dddcb2399131.tar.bz2
re PR target/19399 (mutexes support broken)
2005-01-13 Ralf Corsepius <ralf.corsepius@rtems.org> Joel Sherrill <joel@oarcorp.com> PR target/19399 * gthr-rtems.h (__gthread_recursive_mutex_t): New type. (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): Define to rtems_gxx_recursive_mutex_init. (__gthread_recursive_mutex_lock): New function. (__gthread_recursive_mutex_trylock): Likewise. (__gthread_recursive_mutex_unlock): Likewise. Co-Authored-By: Joel Sherrill <joel@OARcorp.com> From-SVN: r93601
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/gthr-rtems.h28
2 files changed, 38 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f788439..0b8b1a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2005-01-13 Ralf Corsepius <ralf.corsepius@rtems.org>
+ Joel Sherrill <joel@oarcorp.com>
+
+ PR target/19399
+ * gthr-rtems.h (__gthread_recursive_mutex_t): New type.
+ (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): Define to
+ rtems_gxx_recursive_mutex_init.
+ (__gthread_recursive_mutex_lock): New function.
+ (__gthread_recursive_mutex_trylock): Likewise.
+ (__gthread_recursive_mutex_unlock): Likewise.
+
2005-01-13 Ralf Corsepius <ralf.corsepius@rtems.org>
* config/i386/t-rtems-i386: Multilib on -mtune instead of -mcpu.
diff --git a/gcc/gthr-rtems.h b/gcc/gthr-rtems.h
index 7315252..a1b58f6 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.
@@ -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