Subversion Repositories HelenOS

Rev

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

Rev 2216 Rev 2285
Line 205... Line 205...
205
         goto loop;
205
         goto loop;
206
    }
206
    }
207
 
207
 
208
    interrupts_disable();
208
    interrupts_disable();
209
   
209
   
210
    for (i = 0; i<RQ_COUNT; i++) {
210
    for (i = 0; i < RQ_COUNT; i++) {
211
        r = &CPU->rq[i];
211
        r = &CPU->rq[i];
212
        spinlock_lock(&r->lock);
212
        spinlock_lock(&r->lock);
213
        if (r->n == 0) {
213
        if (r->n == 0) {
214
            /*
214
            /*
215
             * If this queue is empty, try a lower-priority queue.
215
             * If this queue is empty, try a lower-priority queue.
Line 449... Line 449...
449
        default:
449
        default:
450
            /*
450
            /*
451
             * Entering state is unexpected.
451
             * Entering state is unexpected.
452
             */
452
             */
453
            panic("tid%llu: unexpected state %s\n", THREAD->tid,
453
            panic("tid%llu: unexpected state %s\n", THREAD->tid,
454
                thread_states[THREAD->state]);
454
                thread_states[THREAD->state]);
455
            break;
455
            break;
456
        }
456
        }
457
 
457
 
458
        THREAD = NULL;
458
        THREAD = NULL;
459
    }
459
    }
Line 569... Line 569...
569
 
569
 
570
    /*
570
    /*
571
     * Searching least priority queues on all CPU's first and most priority
571
     * Searching least priority queues on all CPU's first and most priority
572
     * queues on all CPU's last.
572
     * queues on all CPU's last.
573
     */
573
     */
574
    for (j= RQ_COUNT - 1; j >= 0; j--) {
574
    for (j = RQ_COUNT - 1; j >= 0; j--) {
575
        for (i = 0; i < config.cpu_active; i++) {
575
        for (i = 0; i < config.cpu_active; i++) {
576
            link_t *l;
576
            link_t *l;
577
            runq_t *r;
577
            runq_t *r;
578
            cpu_t *cpu;
578
            cpu_t *cpu;
579
 
579
 
Line 610... Line 610...
610
                 * steal threads whose FPU context is still in
610
                 * steal threads whose FPU context is still in
611
                 * CPU.
611
                 * CPU.
612
                 */
612
                 */
613
                spinlock_lock(&t->lock);
613
                spinlock_lock(&t->lock);
614
                if ((!(t->flags & (THREAD_FLAG_WIRED |
614
                if ((!(t->flags & (THREAD_FLAG_WIRED |
615
                    THREAD_FLAG_STOLEN))) &&
615
                    THREAD_FLAG_STOLEN))) &&
616
                    (!(t->fpu_context_engaged)) ) {
616
                    (!(t->fpu_context_engaged))) {
617
                    /*
617
                    /*
618
                     * Remove t from r.
618
                     * Remove t from r.
619
                     */
619
                     */
620
                    spinlock_unlock(&t->lock);
620
                    spinlock_unlock(&t->lock);
621
                   
621