aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Villemoes <rv@rasmusvillemoes.dk>2020-10-02 15:26:26 +0000
committerOlivier Hainque <hainque@adacore.com>2020-10-16 16:14:52 +0000
commite94d5836e54558f78f1845de07db273611972c26 (patch)
tree95870540a8ce5373bf8b389127654e750ecb147c
parent0aeeda8fc2944e73b4bf50ee0da55f76baad3cf8 (diff)
downloadgcc-e94d5836e54558f78f1845de07db273611972c26.zip
gcc-e94d5836e54558f78f1845de07db273611972c26.tar.gz
gcc-e94d5836e54558f78f1845de07db273611972c26.tar.bz2
Inhibit support for gthread condvars on VxWorks < 6
The condition variables support relies on kernel entry points to enforce critical aspects of it's expected behavior. Some of these entry points are not available prior to VxWorks 6, so we just expose absence of support for condition variables on such systems. 2020-10-15 Rasmus Villemoes <rv@rasmusvillemoes.dk> libgcc/ * config/gthr-vxworks.h: Condition the __GTHREAD_HAS_COND section on VxWorks >= 6. * config/gthr-vxworks-cond.c: Condition the entire implementation on __GTHREAD_HAS_COND.
-rw-r--r--libgcc/config/gthr-vxworks-cond.c4
-rw-r--r--libgcc/config/gthr-vxworks.h8
2 files changed, 12 insertions, 0 deletions
diff --git a/libgcc/config/gthr-vxworks-cond.c b/libgcc/config/gthr-vxworks-cond.c
index 65f0a6a..ba384b4 100644
--- a/libgcc/config/gthr-vxworks-cond.c
+++ b/libgcc/config/gthr-vxworks-cond.c
@@ -26,6 +26,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
This file implements the GTHREAD_HAS_COND part of the interface
exposed by gthr-vxworks.h. */
+#if __GTHREAD_HAS_COND
+
#include "gthr.h"
#include <taskLib.h>
@@ -79,3 +81,5 @@ __gthread_cond_wait_recursive (__gthread_cond_t *cond,
{
return __gthread_cond_wait (cond, mutex);
}
+
+#endif
diff --git a/libgcc/config/gthr-vxworks.h b/libgcc/config/gthr-vxworks.h
index e381747..d49809a 100644
--- a/libgcc/config/gthr-vxworks.h
+++ b/libgcc/config/gthr-vxworks.h
@@ -234,6 +234,12 @@ extern int __gthread_setspecific (__gthread_key_t __key, void *__ptr);
/* ------------------ Base condition variables support ------------------- */
+/* VxWorks prio to 6 misses a few services key to a correct
+ implementation of condition variables with reasonable complexity.
+ semExchange in particular. */
+
+#if _VXWORKS_MAJOR_GE(6)
+
#define __GTHREAD_HAS_COND 1
typedef SEM_ID __gthread_cond_t;
@@ -254,6 +260,8 @@ extern int __gthread_cond_wait (__gthread_cond_t *cond,
extern int __gthread_cond_wait_recursive (__gthread_cond_t *cond,
__gthread_recursive_mutex_t *mutex);
+#endif
+
/* ----------------------- C++0x thread support ------------------------- */
/* We do not support C++0x threads on that VxWorks 653, which we can