summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kern/mutex.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/kern/mutex.h b/kern/mutex.h
index 2f46ca8c..3a74eb2f 100644
--- a/kern/mutex.h
+++ b/kern/mutex.h
@@ -23,6 +23,7 @@
#ifndef _KERN_MUTEX_H
#define _KERN_MUTEX_H
+#include <kern/assert.h>
#include <kern/list.h>
#include <kern/spinlock.h>
@@ -41,6 +42,8 @@ struct mutex {
void mutex_init(struct mutex *mutex);
+#define mutex_assert_locked(mutex) assert((mutex)->state != MUTEX_UNLOCKED)
+
/*
* Return 0 on success, 1 if busy.
*/