Skip to content
Snippets Groups Projects
Commit 62035f36 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

* add some more debug statements

parent f47541c3
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ int mutex_init(struct mutex_t* mutex) { ...@@ -35,6 +35,7 @@ int mutex_init(struct mutex_t* mutex) {
} }
int mutex_trylock(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); return (atomic_set_return(&mutex->val, thread_pid ) == 0);
} }
...@@ -43,7 +44,7 @@ int prio() { ...@@ -43,7 +44,7 @@ int prio() {
} }
int mutex_lock(struct mutex_t* mutex) { 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) { if (atomic_set_return(&mutex->val,thread_pid) != 0) {
// mutex was locked. // mutex was locked.
...@@ -106,6 +107,7 @@ void mutex_wake_waiters(struct mutex_t *mutex, int flags) { ...@@ -106,6 +107,7 @@ void mutex_wake_waiters(struct mutex_t *mutex, int flags) {
/* queue is empty */ /* queue is empty */
if (!next) { if (!next) {
DEBUG("%s: no waiters?\n", active_thread->name);
mutex->val = 0; mutex->val = 0;
if ( ! (flags & MUTEX_INISR)) eINT(); if ( ! (flags & MUTEX_INISR)) eINT();
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment