summaryrefslogtreecommitdiff
path: root/kern/mutex_types.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-03-04 16:27:05 +0100
committerRichard Braun <rbraun@sceen.net>2017-03-04 16:52:30 +0100
commitf4d75d0cd8424c17521d520fd9018ea22b7daaad (patch)
treea6f4807984c781e3584c79491ecb23e75f012ac6 /kern/mutex_types.h
parent3fcd23576e800ebbfb1378c2e6aff2e9e1027989 (diff)
kern/mutex: implement the --enable-mutex-pi option
This option turns all regular mutexes into real-time mutexes.
Diffstat (limited to 'kern/mutex_types.h')
-rw-r--r--kern/mutex_types.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/kern/mutex_types.h b/kern/mutex_types.h
index e3126b10..4b7947fc 100644
--- a/kern/mutex_types.h
+++ b/kern/mutex_types.h
@@ -21,8 +21,24 @@
#ifndef _KERN_MUTEX_TYPES_H
#define _KERN_MUTEX_TYPES_H
+#ifdef X15_MUTEX_PI
+
+#include <kern/rtmutex_types.h>
+
+/*
+ * Do not directly alias rtmutex to make sure they cannot be used
+ * with condition variables by mistake.
+ */
+struct mutex {
+ struct rtmutex rtmutex;
+};
+
+#else /* X15_MUTEX_PI */
+
struct mutex {
unsigned int state;
};
+#endif /* X15_MUTEX_PI */
+
#endif /* _KERN_MUTEX_TYPES_H */