// FOSA(Frescor Operating System Adaptation layer)
//================================================
+#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
******************************************************/
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);
}
**/
int fosa_cond_timedwait(fosa_cond_t *cond,
fosa_mutex_t *mutex,
- const struct timespec *abstime)
+ const fosa_abs_time_t *abstime)
{
- return pthread_cond_timedwait(cond, mutex, abstime);
+ struct timespec abstime_tspec;
+
+ abstime_tspec = fosa_abs_time_to_timespec(*abstime);
+
+ return pthread_cond_timedwait(cond, mutex, &abstime_tspec);
}