diff --git a/core/thread.c b/core/thread.c index 779fc2b6b5dcf17763937c1867e17f29e3772745..8afbcb844613fd9ba1485075c212a6bf20652bd4 100644 --- a/core/thread.c +++ b/core/thread.c @@ -45,11 +45,16 @@ void thread_sleep() { } int thread_wakeup(int pid) { + DEBUG("thread_wakeup: Trying to wakeup PID %i...\n", pid); int isr = inISR(); - if (! isr) dINT(); + if (! isr) { + DEBUG("thread_wakeup: Not in interrupt.\n"); + dINT(); + } int result = sched_threads[pid]->status; if (result == STATUS_SLEEPING) { + DEBUG("thread_wakeup: Thread is sleeping.\n"); sched_set_status((tcb*)sched_threads[pid], STATUS_RUNNING); if (!isr) { eINT(); @@ -59,6 +64,7 @@ int thread_wakeup(int pid) { } return 0; } else { + DEBUG("thread_wakeup: Thread is not sleeping!\n"); if (!isr) eINT(); return STATUS_NOT_FOUND; }