diff --git a/core/mutex.c b/core/mutex.c index cba168ee81..9bf8690e68 100644 --- a/core/mutex.c +++ b/core/mutex.c @@ -49,7 +49,9 @@ static inline __attribute__((always_inline)) void _block(mutex_t *mutex, unsigned irq_state) { thread_t *me = thread_get_active(); - + /* Fail visibly even if a blocking action is called from somewhere where + * it's subtly not allowed, eg. board_init */ + assert(me != NULL); DEBUG("PID[%" PRIkernel_pid "] mutex_lock() Adding node to mutex queue: " "prio: %" PRIu32 "\n", thread_getpid(), (uint32_t)me->priority); sched_set_status(me, STATUS_MUTEX_BLOCKED);