diff options
author | Richard Braun <rbraun@sceen.net> | 2013-04-13 15:12:09 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-04-13 15:12:41 +0200 |
commit | b9ad029638692203505438f67b3d80edb73f9d82 (patch) | |
tree | 62d05b04ed97eac47049e9395f6f479e71508602 /kern/mutex.h | |
parent | c0fb9d9c300480a865158be6dc78e9225e0b310e (diff) |
kern/mutex: new mutex_assert_locked macro
Diffstat (limited to 'kern/mutex.h')
-rw-r--r-- | kern/mutex.h | 3 |
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. */ |