diff options
author | Richard Braun <rbraun@sceen.net> | 2018-07-30 20:55:20 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-07-30 20:55:20 +0200 |
commit | 5f202c9f744a5d9c5b751038edd2379b3d244227 (patch) | |
tree | c5bce5b9e1d9c4b01dfed4ff941ad9944814b93c /kern/mutex/mutex_pi_i.h | |
parent | d3e43f5bfda0bdad7a829a7ed8c1272a395b196b (diff) |
Rework assertive functions
Instead of combining assertions and checking into single functions,
rework those into pure checking functions usable with assert().
Those functions were introduced because of warnings about unused
functions/variables caused by an earlier implementation of assert().
Diffstat (limited to 'kern/mutex/mutex_pi_i.h')
-rw-r--r-- | kern/mutex/mutex_pi_i.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kern/mutex/mutex_pi_i.h b/kern/mutex/mutex_pi_i.h index f3bb28fa..1b79c202 100644 --- a/kern/mutex/mutex_pi_i.h +++ b/kern/mutex/mutex_pi_i.h @@ -23,6 +23,7 @@ " use <kern/mutex.h> instead" #endif +#include <stdbool.h> #include <stdint.h> #include <kern/mutex_types.h> @@ -38,8 +39,11 @@ mutex_impl_init(struct mutex *mutex) rtmutex_init(&mutex->rtmutex); } -#define mutex_impl_assert_locked(mutex) \ - rtmutex_assert_locked(&(mutex)->rtmutex) +static inline bool +mutex_impl_locked(const struct mutex *mutex) +{ + return rtmutex_locked(&mutex->rtmutex); +} static inline int mutex_impl_trylock(struct mutex *mutex) |