summaryrefslogtreecommitdiff
path: root/kern/condition.h
diff options
context:
space:
mode:
Diffstat (limited to 'kern/condition.h')
-rw-r--r--kern/condition.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/kern/condition.h b/kern/condition.h
index 1b0242e7..6802063b 100644
--- a/kern/condition.h
+++ b/kern/condition.h
@@ -35,7 +35,13 @@ struct condition {
#define CONDITION_INITIALIZER(condition) \
{ SPINLOCK_INITIALIZER, NULL, LIST_INITIALIZER((condition).waiters) }
-void condition_init(struct condition *cond);
+static inline void
+condition_init(struct condition *condition)
+{
+ spinlock_init(&condition->lock);
+ condition->mutex = NULL;
+ list_init(&condition->waiters);
+}
void condition_wait(struct condition *cond, struct mutex *mutex);