Subversion Repositories HelenOS-historic

Rev

Rev 170 | Rev 192 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 170 Rev 184
Line 250... Line 250...
250
         */
250
         */
251
        THREAD->saved_context.pri = pri;
251
        THREAD->saved_context.pri = pri;
252
    }
252
    }
253
 
253
 
254
    /*
254
    /*
-
 
255
     * Through the 'THE' structure, we keep track of THREAD, TASK, CPU
-
 
256
     * and preemption counter. At this point THE could be coming either
-
 
257
     * from THREAD's or CPU's stack.
-
 
258
     */
-
 
259
    the_copy(THE, (the_t *) CPU->stack);
-
 
260
 
-
 
261
    /*
255
     * We may not keep the old stack.
262
     * We may not keep the old stack.
256
     * Reason: If we kept the old stack and got blocked, for instance, in
263
     * Reason: If we kept the old stack and got blocked, for instance, in
257
     * find_best_thread(), the old thread could get rescheduled by another
264
     * find_best_thread(), the old thread could get rescheduled by another
258
     * CPU and overwrite the part of its own stack that was also used by
265
     * CPU and overwrite the part of its own stack that was also used by
259
     * the scheduler on this CPU.
266
     * the scheduler on this CPU.
Line 395... Line 402...
395
 
402
 
396
    #ifdef SCHEDULER_VERBOSE
403
    #ifdef SCHEDULER_VERBOSE
397
    printf("cpu%d: tid %d (pri=%d,ticks=%d,nrdy=%d)\n", CPU->id, THREAD->tid, THREAD->pri, THREAD->ticks, CPU->nrdy);
404
    printf("cpu%d: tid %d (pri=%d,ticks=%d,nrdy=%d)\n", CPU->id, THREAD->tid, THREAD->pri, THREAD->ticks, CPU->nrdy);
398
    #endif  
405
    #endif  
399
 
406
 
-
 
407
    the_copy(THE, (the_t *) THREAD->kstack);
-
 
408
   
400
    context_restore(&THREAD->saved_context);
409
    context_restore(&THREAD->saved_context);
401
    /* not reached */
410
    /* not reached */
402
}
411
}
403
 
412
 
404
 
413