diff --git a/core/mutex.c b/core/mutex.c index 42e356196a14070492c573ab5f76ab697f0883a2..affc7cb622bc0e793f91e41c305b395cdc01f2bd 100644 --- a/core/mutex.c +++ b/core/mutex.c @@ -35,6 +35,7 @@ int mutex_init(struct mutex_t* mutex) { } int mutex_trylock(struct mutex_t* mutex) { + DEBUG("%s: trylocking to get mutex. val: %u\n", active_thread->name, mutex->val); return (atomic_set_return(&mutex->val, thread_pid ) == 0); } @@ -43,7 +44,7 @@ int prio() { } int mutex_lock(struct mutex_t* mutex) { - DEBUG("%s: trying to get mutex. val: %u\n", active_thread->name, mutex->val); + DEBUG("%s: trying to get mutex. val: %u\n", active_thread->name, mutex->val); if (atomic_set_return(&mutex->val,thread_pid) != 0) { // mutex was locked. @@ -106,6 +107,7 @@ void mutex_wake_waiters(struct mutex_t *mutex, int flags) { /* queue is empty */ if (!next) { + DEBUG("%s: no waiters?\n", active_thread->name); mutex->val = 0; if ( ! (flags & MUTEX_INISR)) eINT(); return;