1
0
Fork 0
forked from len0rd/rockbox

Add CPU mode asserts to kernel on blocking functions.

This scourge finds it's way back in far too often.
Right now, only defined for ARM.

Have fun!

Change-Id: Ib21be09ebf71dec10dc652a7a664779251f49644
This commit is contained in:
Michael Sevakis 2017-01-21 14:18:37 -05:00
parent da46457231
commit 3e73866110
7 changed files with 54 additions and 1 deletions

View file

@ -39,6 +39,8 @@ void mutex_init(struct mutex *m)
/* Gain ownership of a mutex object or block until it becomes free */
void mutex_lock(struct mutex *m)
{
ASSERT_CPU_MODE(CPU_MODE_THREAD_CONTEXT);
struct thread_entry *current = __running_self_entry();
if(current == m->blocker.thread)