/SPARTAN/trunk/src/proc/scheduler.c |
---|
135,7 → 135,7 |
spinlock_unlock(&r->lock); |
continue; |
} |
/* avoid deadlock with relink_rq() */ |
if (!spinlock_trylock(&CPU->lock)) { |
/* |
412,6 → 412,9 |
printf("cpu%d: tid %d (pri=%d,ticks=%d,nrdy=%d)\n", CPU->id, THREAD->tid, THREAD->pri, THREAD->ticks, CPU->nrdy); |
#endif |
/* |
* Copy the knowledge of CPU, TASK, THREAD and preemption counter to thread's stack. |
*/ |
the_copy(THE, (the_t *) THREAD->kstack); |
context_restore(&THREAD->saved_context); |
/SPARTAN/trunk/src/proc/thread.c |
---|
75,9 → 75,9 |
void (*f)(void *) = THREAD->thread_code; |
void *arg = THREAD->thread_arg; |
/* this is where each thread wakes up after its creation */ |
before_thread_runs(); |
/* this is where each thread wakes up after its creation */ |
spinlock_unlock(&THREAD->lock); |
cpu_priority_low(); |