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:
parent
f4764fc348
commit
6f357b60ff
1 changed files with 1 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue