unified/kernel: Assert that mutex is not unlocked without previous locking

Add an assertion against unlocking mutex that is not locked.

Change-Id: I1032fb904e364015b486502c035529c8fe31de7a
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This commit is contained in:
Dmitriy Korovkin 2016-11-04 15:18:07 -04:00 committed by Benjamin Walsh
commit 6f357b60ff

View file

@ -214,6 +214,7 @@ void k_mutex_unlock(struct k_mutex *mutex)
{
int key;
__ASSERT(mutex->lock_count > 0, "");
__ASSERT(mutex->owner == _current, "");
k_sched_lock();