diff options
author | Richard Braun <rbraun@sceen.net> | 2017-02-10 21:25:28 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-02-10 21:25:28 +0100 |
commit | 23f670b418456427552590bf06e419e66a0ca747 (patch) | |
tree | 96c64095d9224adac10cd66b1bbda5ab15020302 /kern/mutex.h | |
parent | e69a4c4c3ca62d816bb4542792bcc741a7360af2 (diff) |
kern/mutex: make mutex_trylock return ERROR_BUSY instead of 1
Diffstat (limited to 'kern/mutex.h')
-rw-r--r-- | kern/mutex.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kern/mutex.h b/kern/mutex.h index 5ea8061e..64efa350 100644 --- a/kern/mutex.h +++ b/kern/mutex.h @@ -24,6 +24,7 @@ #define _KERN_MUTEX_H #include <kern/assert.h> +#include <kern/error.h> #include <kern/list.h> #include <kern/mutex_i.h> #include <kern/mutex_types.h> @@ -41,9 +42,6 @@ mutex_init(struct mutex *mutex) #define mutex_assert_locked(mutex) assert((mutex)->state != MUTEX_UNLOCKED) -/* - * Return 0 on success, 1 if busy. - */ static inline int mutex_trylock(struct mutex *mutex) { @@ -55,7 +53,7 @@ mutex_trylock(struct mutex *mutex) return 0; } - return 1; + return ERROR_BUSY; } static inline void |