summaryrefslogtreecommitdiff
path: root/gcc/gthr-vxworks.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gthr-vxworks.h')
-rw-r--r--gcc/gthr-vxworks.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/gthr-vxworks.h b/gcc/gthr-vxworks.h
index 4fb3b09404a..0f3ad23412a 100644
--- a/gcc/gthr-vxworks.h
+++ b/gcc/gthr-vxworks.h
@@ -45,7 +45,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include <semLib.h>
typedef SEM_ID __gthread_mutex_t;
+/* All VxWorks mutexes are recursive. */
+typedef SEM_ID __gthread_recursive_mutex_t;
#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
+#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
static inline void
__gthread_mutex_init_function (__gthread_mutex_t *mutex)
@@ -71,6 +74,30 @@ __gthread_mutex_unlock (__gthread_mutex_t *mutex)
return semGive (*mutex);
}
+static inline void
+__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex)
+{
+ __gthread_mutex_init_function (mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
+{
+ return __gthread_mutex_lock (mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
+{
+ return __gthread_mutex_trylock (mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
+{
+ return __gthread_mutex_unlock (mutex);
+}
+
/* pthread_once is complicated enough that it's implemented
out-of-line. See config/vxlib.c. */