]> rtime.felk.cvut.cz Git - frescor/fosa.git/commitdiff
Aquosa: priority inheritance can be disabled
authorsojkam <sojkam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Thu, 6 Nov 2008 15:43:13 +0000 (15:43 +0000)
committersojkam <sojkam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Thu, 6 Nov 2008 15:43:13 +0000 (15:43 +0000)
It is necessary for debugging with Valgrind as it is not supported
(valgrind-3.3.1-Debian).

git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@1370 35b4ef3e-fd22-0410-ab77-dab3279adceb

src_aquosa/Makefile.omk
src_aquosa/fosa_mutexes_and_condvars.c

index 9b9a2b03a266da744d0451a63642b20a771d01e5..ea8d433bef385d70c2bf0290c624cfad98b1d275 100644 (file)
@@ -1,5 +1,8 @@
 SUBDIRS = $(ALL_OMK_SUBDIRS)
 
+default_CONFIG = CONFIG_NO_PRIO_INHERIT=n
+LOCAL_CONFIG_H = fosa_config.h
+
 #lib_LIBRARIES=fosa
 shared_LIBRARIES=fosa
 fosa_SOURCES=$(notdir $(wildcard $(SOURCES_DIR)/*.c))
index b940b988a11f5386d8af3ad36198d028b4441614..8b03c8d488cf8b41f1dd3a08fb7e266d43aa587e 100644 (file)
 #include "fosa_time.h"
 #include "fosa_mutexes_and_condvars.h"
 
+#ifdef OMK_FOR_USER            /* If compiled by OMK, use the config */
+#include "fosa_config.h"
+#endif
+
 /*******************************************************
  * Mutexes with priority/bandwidth inheritance
  ******************************************************/
@@ -88,9 +92,10 @@ int fosa_mutex_init(fosa_mutex_t *mutex, int prioceiling)
        if ((error = pthread_mutexattr_init(&attr)) != 0)
                return error;
 
+#ifndef CONFIG_NO_PRIO_INHERIT /* Valgrind doesn't support this attribute */
        if ((error = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT)) != 0)
                return error;
-
+#endif
        return pthread_mutex_init(mutex, &attr);
 }