summaryrefslogtreecommitdiff
path: root/kern/condition_types.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-02-04 16:21:10 +0100
committerRichard Braun <rbraun@sceen.net>2017-02-04 16:21:10 +0100
commit7a00044da882d30b1dea8757c7f6a1ccaa9ee08d (patch)
tree9e342eca8a673ac9b0982c3e4bda22ff5158690e /kern/condition_types.h
parentd09b913612712c7d58e5ee3ee20703cce63ad0b0 (diff)
kern/types: split into module-specific type headers
Using a single header for all types causing inclusion circular dependencies isn't very elegant and doesn't scale.
Diffstat (limited to 'kern/condition_types.h')
-rw-r--r--kern/condition_types.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/kern/condition_types.h b/kern/condition_types.h
new file mode 100644
index 00000000..9f68bf44
--- /dev/null
+++ b/kern/condition_types.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Isolated type definition used to avoid inclusion circular dependencies.
+ */
+
+#ifndef _KERN_CONDITION_TYPES_H
+#define _KERN_CONDITION_TYPES_H
+
+#include <kern/list.h>
+#include <kern/mutex_types.h>
+#include <kern/spinlock_types.h>
+
+struct condition {
+ struct spinlock lock;
+ struct mutex *mutex;
+ struct list waiters;
+};
+
+#endif /* _KERN_CONDITION_TYPES_H */